Skip to content

Commit 26b22b7

Browse files
committed
feat(API): Update batch schedule
Schedule one-half of each library for each day to account for larger libraries
1 parent 209cdc9 commit 26b22b7

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

API/schedule.js

+16-16
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,28 @@ const timestamp = require('console-timestamp');
99
const secure = require('./secure.json');
1010

1111
const batchSchedule = {
12-
bio: '1,15',
13-
biz: '2,16',
14-
chem: '3,17',
15-
eng: '4,18',
16-
espanol: '5,19',
17-
geo: '6,20',
18-
human: '7,21',
19-
k12: '8,22',
20-
math: '9,23',
21-
med: '10,24',
22-
phys: '11,25',
23-
socialsci: '12,26',
24-
stats: '13,27',
25-
workforce: '14,28',
12+
bio: 1,
13+
biz: 3,
14+
chem: 5,
15+
eng: 7,
16+
espanol: 9,
17+
geo: 10,
18+
human: 12,
19+
k12: 14,
20+
math: 16,
21+
med: 18,
22+
phys: 20,
23+
socialsci: 22,
24+
stats: 24,
25+
workforce: 26,
2626
};
2727

2828
/**
2929
* Adds the scheduler job for a given library and target.
3030
*
3131
* @param {string} library - The LibreTexts library shortened identifier.
3232
* @param {string} target - The area of the library to batch.
33-
* @param {string} timeSpec - The days of the month to run the job.
33+
* @param {number|string} timeSpec - The day(s) of the month to run the job.
3434
* @param {number} [timeOffset=0] - An offset to apply to the batch job's schedule.
3535
*/
3636
function scheduleLibraryBatch(library, target, timeSpec, timeOffset = 0) {
@@ -146,7 +146,7 @@ function initialize() {
146146
const timeSpec = batchSchedule[library];
147147
if (library !== 'espanol') {
148148
scheduleLibraryBatch(library, 'bookshelves', timeSpec);
149-
scheduleLibraryBatch(library, 'courses', timeSpec, 12);
149+
scheduleLibraryBatch(library, 'courses', timeSpec + 1);
150150
} else {
151151
scheduleLibraryBatch(library, 'home', timeSpec);
152152
}

0 commit comments

Comments
 (0)