sr-npm 1.7.211 → 1.7.212
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/backend/data.js +6 -12
- package/package.json +1 -1
package/backend/data.js
CHANGED
|
@@ -326,9 +326,7 @@ async function referenceJobs() {
|
|
|
326
326
|
|
|
327
327
|
async function syncJobsFast() {
|
|
328
328
|
console.log("Syncing jobs fast");
|
|
329
|
-
console.log("Creating collections");
|
|
330
329
|
await createCollections();
|
|
331
|
-
console.log("created collections successfully");
|
|
332
330
|
await clearCollections();
|
|
333
331
|
console.log("saving jobs data to CMS");
|
|
334
332
|
await saveJobsDataToCMS();
|
|
@@ -336,22 +334,18 @@ async function syncJobsFast() {
|
|
|
336
334
|
console.log("saving jobs descriptions and location apply url to CMS");
|
|
337
335
|
await saveJobsDescriptionsAndLocationApplyUrlToCMS();
|
|
338
336
|
console.log("saved jobs descriptions and location apply url to CMS successfully");
|
|
339
|
-
console.log("aggregating jobs");
|
|
340
337
|
await aggregateJobs();
|
|
341
|
-
console.log("aggregated jobs successfully");
|
|
342
|
-
console.log("referencing jobs");
|
|
343
338
|
await referenceJobs();
|
|
344
|
-
console.log("referenced jobs successfully");
|
|
345
339
|
console.log("syncing jobs fast finished successfully");
|
|
346
340
|
}
|
|
347
341
|
|
|
348
342
|
async function clearCollections() {
|
|
349
|
-
console.log("clearing
|
|
350
|
-
await
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
343
|
+
console.log("clearing collections");
|
|
344
|
+
await Promise.all([
|
|
345
|
+
wixData.truncate(COLLECTIONS.CITIES),
|
|
346
|
+
wixData.truncate(COLLECTIONS.AMOUNT_OF_JOBS_PER_DEPARTMENT),
|
|
347
|
+
wixData.truncate(COLLECTIONS.JOBS)
|
|
348
|
+
]);
|
|
355
349
|
console.log("cleared collections successfully");
|
|
356
350
|
}
|
|
357
351
|
|