sr-npm 1.7.562 → 1.7.564

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/consts.js CHANGED
@@ -1,13 +1,12 @@
1
- const {saveJobsDataToCMS,saveJobsDescriptionsAndLocationApplyUrlToCMS,createCollections,aggregateJobs,referenceJobs,syncJobsFast} = require('./data')
1
+ const {saveJobsDataToCMS,saveJobsDescriptionsAndLocationApplyUrlReferencesToCMS,createCollections,aggregateJobs,referenceJobs,syncJobsFast} = require('./data')
2
2
 
3
3
 
4
4
  const QUERY_MAX_LIMIT = 1000;
5
5
 
6
6
  const TASKS_NAMES = {
7
7
  SYNC_JOBS: 'syncJobsFromSRAPIToCMS',
8
- SYNC_JOBS_SPLITTED: 'syncJobsFromSRAPIToCMSSplitted',
9
8
  INSERT_JOBS_TO_CMS: 'insertJobsToCMS',
10
- INSERT_JOBS_DESCRIPTIONS_LOCATION_APPLY_URL_TO_CMS: 'insertJobsDescriptionsLocationApplyUrlToCMS',
9
+ INSERT_JOBS_DESCRIPTIONS_LOCATION_APPLY_URL_REFERENCES_TO_CMS: 'insertJobsDescriptionsLocationApplyUrlReferencesToCMS',
11
10
  AGGREGATE_JOBS_BY_FIELD_TO_CMS: 'aggregateJobsByFieldToCMS',
12
11
  REFERENCE_JOBS: 'referenceJobs',
13
12
  CREATE_COLLECTIONS: 'createCollections',
@@ -22,19 +21,7 @@ const TASKS = {
22
21
  childTasks: [
23
22
  { name: TASKS_NAMES.CREATE_COLLECTIONS},
24
23
  { name: TASKS_NAMES.INSERT_JOBS_TO_CMS },
25
- { name: TASKS_NAMES.INSERT_JOBS_DESCRIPTIONS_LOCATION_APPLY_URL_TO_CMS },
26
- { name: TASKS_NAMES.AGGREGATE_JOBS_BY_FIELD_TO_CMS },
27
- {name: TASKS_NAMES.REFERENCE_JOBS},
28
- ],
29
- scheduleChildrenSequentially: true,
30
- estimatedDurationSec: 60,
31
- },
32
- [TASKS_NAMES.SYNC_JOBS_SPLITTED]: {
33
- name: TASKS_NAMES.SYNC_JOBS_SPLITTED,
34
- childTasks: [
35
- { name: TASKS_NAMES.CREATE_COLLECTIONS},
36
- { name: TASKS_NAMES.INSERT_JOBS_TO_CMS },
37
- { name: TASKS_NAMES.INSERT_JOBS_DESCRIPTIONS_LOCATION_APPLY_URL_TO_CMS },
24
+ { name: TASKS_NAMES.INSERT_JOBS_DESCRIPTIONS_LOCATION_APPLY_URL_REFERENCES_TO_CMS },
38
25
  { name: TASKS_NAMES.AGGREGATE_JOBS_BY_FIELD_TO_CMS },
39
26
  {name: TASKS_NAMES.REFERENCE_JOBS},
40
27
  ],
@@ -55,10 +42,10 @@ const TASKS = {
55
42
  shouldSkipCheck:()=>false,
56
43
  estimatedDurationSec:20
57
44
  },
58
- [TASKS_NAMES.INSERT_JOBS_DESCRIPTIONS_LOCATION_APPLY_URL_TO_CMS]: {
59
- name: TASKS_NAMES.INSERT_JOBS_DESCRIPTIONS_LOCATION_APPLY_URL_TO_CMS,
45
+ [TASKS_NAMES.INSERT_JOBS_DESCRIPTIONS_LOCATION_APPLY_URL_REFERENCES_TO_CMS]: {
46
+ name: TASKS_NAMES.INSERT_JOBS_DESCRIPTIONS_LOCATION_APPLY_URL_REFERENCES_TO_CMS,
60
47
  getIdentifier:()=> "SHOULD_NEVER_SKIP",
61
- process:saveJobsDescriptionsAndLocationApplyUrlToCMS,
48
+ process:saveJobsDescriptionsAndLocationApplyUrlReferencesToCMS,
62
49
  shouldSkipCheck:()=>false,
63
50
  estimatedDurationSec:20
64
51
  },
package/backend/data.js CHANGED
@@ -211,9 +211,15 @@ async function saveJobsDescriptionsAndLocationApplyUrlReferencesToCMS() {
211
211
  try {
212
212
  let jobsWithNoDescriptions = await getJobsWithNoDescriptions();
213
213
  let customValues=await getAllCustomValues();
214
- for (const valueId of customValues.items) {
215
- await insertJobsReference(valueId);
214
+ console.log("customValues: ", customValues);
215
+ console.log("jobToCustomValues: ", jobToCustomValues);
216
+ console.log("customValuesToJobs: ", customValuesToJobs);
217
+
218
+ console.log("inserting jobs references");
219
+ for (const value of customValues.items) {
220
+ await insertJobsReference(value._id);
216
221
  }
222
+ console.log("inserted jobs references successfully");
217
223
 
218
224
 
219
225
  let totalUpdated = 0;
@@ -462,21 +468,8 @@ async function syncJobsFast() {
462
468
  await referenceJobs();
463
469
  console.log("syncing jobs fast finished successfully");
464
470
  }
465
- async function syncJobsFastSplitted() {
466
- console.log("Syncing jobs fast");
467
- await createCollections();
468
- await clearCollections();
469
- await fillSecretManagerMirror();
470
- console.log("saving jobs data to CMS");
471
- await saveJobsDataToCMS();
472
- console.log("saved jobs data to CMS successfully");
473
- console.log("saving jobs descriptions and location apply url to CMS");
474
- await saveJobsDescriptionsAndLocationApplyUrlReferencesToCMS();
475
- console.log("saved jobs descriptions and location apply url to CMS successfully");
476
- await aggregateJobs();
477
- await referenceJobs();
478
- console.log("syncing jobs fast finished successfully");
479
- }
471
+
472
+
480
473
 
481
474
  async function clearCollections() {
482
475
  console.log("clearing collections");
@@ -535,7 +528,7 @@ module.exports = {
535
528
  aggregateJobs,
536
529
  createCollections,
537
530
  saveJobsDataToCMS,
538
- saveJobsDescriptionsAndLocationApplyUrlToCMS: saveJobsDescriptionsAndLocationApplyUrlReferencesToCMS,
531
+ saveJobsDescriptionsAndLocationApplyUrlReferencesToCMS,
539
532
  aggregateJobsByFieldToCMS,
540
533
  referenceJobsToField,
541
534
  fillSecretManagerMirror,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sr-npm",
3
- "version": "1.7.562",
3
+ "version": "1.7.564",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {