sr-npm 1.7.167 → 1.7.169

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 CHANGED
@@ -316,8 +316,10 @@ async function createCollections() {
316
316
 
317
317
  async function aggregateJobs() {
318
318
  console.log("Aggregating jobs");
319
- await aggregateJobsByFieldToCMS({ field: JOBS_COLLECTION_FIELDS.CITY_TEXT, collection: COLLECTIONS.CITIES });
320
- await aggregateJobsByFieldToCMS({ field: JOBS_COLLECTION_FIELDS.DEPARTMENT, collection: COLLECTIONS.AMOUNT_OF_JOBS_PER_DEPARTMENT });
319
+ Promise.all([
320
+ aggregateJobsByFieldToCMS({ field: JOBS_COLLECTION_FIELDS.CITY_TEXT, collection: COLLECTIONS.CITIES }),
321
+ aggregateJobsByFieldToCMS({ field: JOBS_COLLECTION_FIELDS.DEPARTMENT, collection: COLLECTIONS.AMOUNT_OF_JOBS_PER_DEPARTMENT })
322
+ ]);
321
323
  console.log("finished aggregating jobs");
322
324
  }
323
325
 
package/backend/utils.js CHANGED
@@ -12,9 +12,12 @@ async function delay(ms) {
12
12
  function countJobsPerGivenField(jobs, field,jobsPerField) {
13
13
  for (const job of jobs) {
14
14
  if (!job[field]) {
15
- throw new Error(`Job ${job._id} has no ${field} field`);
15
+ //throw new Error(`Job ${job._id} has no ${field} field`);
16
+ //skip for now
17
+ }
18
+ else{
19
+ jobsPerField[job[field]] = (jobsPerField[job[field]] || 0) + 1;
16
20
  }
17
- jobsPerField[job[field]] = (jobsPerField[job[field]] || 0) + 1;
18
21
  }
19
22
  }
20
23
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sr-npm",
3
- "version": "1.7.167",
3
+ "version": "1.7.169",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {