Skip to content

Commit 80741a6

Browse files
author
Ives van Hoorne
committed
Warm up cache for new packager
1 parent f9bb4d8 commit 80741a6

File tree

1 file changed

+11
-2
lines changed
  • src/app/store/entities/sandboxes/bundler

1 file changed

+11
-2
lines changed

src/app/store/entities/sandboxes/bundler/index.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,26 @@ import logError from '../../../../utils/error';
99

1010
const debug = _debug('cs:app:packager');
1111

12-
export const PACKAGER_URL = 'https://cdn.jsdelivr.net/webpack/v5';
12+
export const PACKAGER_URL = 'https://cdn.jsdelivr.net/webpack/v4';
13+
export const NEW_PACKAGER_URL = 'https://cdn.jsdelivr.net/webpack/v5';
1314

1415
const RETRY_COUNT = 10;
1516

1617
/**
17-
* Request the packager, if retries > 4 it will throw if something goes wrong
18+
* Request the packager, if retries > RETRY_COUNT it will throw if something goes wrong
1819
* otherwise it will retry again with an incremented retry
1920
*
2021
* @param {string} query The dependencies to call
2122
*/
2223
async function requestPackager(query: string) {
24+
try {
25+
// Call new packager to build cache
26+
const url = `${NEW_PACKAGER_URL}/${query}`;
27+
const result = callApi(`${url}/manifest.json`); // eslint-disable-line
28+
} catch (e) {
29+
// nothing yet
30+
}
31+
2332
let retries = 0;
2433

2534
while (true) {

0 commit comments

Comments
 (0)