File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -11,13 +11,25 @@ import * as watch from './watch.js';
11
11
12
12
log . info ( '🗿 npm ↔️ Algolia replication starts ⛷ 🐌 🛰' ) ;
13
13
14
+ const KILL_PROCESS_EVERY_MS = 12 * 60 * 60 * 1000 ; // every 12 hours
15
+
14
16
/**
15
17
* Main process
16
18
* - Bootstrap: will index the whole list of packages (if needed)
17
19
* - Watch : will process update in real time
18
20
*/
19
21
async function main ( ) {
20
22
const start = Date . now ( ) ;
23
+
24
+ // We schedule to kill the process:
25
+ // - reset cache
26
+ // - maybe retrigger bootstrap
27
+ setTimeout ( ( ) => {
28
+ log . info ( '👋 Scheduled process cleaning' ) ;
29
+ // eslint-disable-next-line no-process-exit
30
+ process . exit ( 0 ) ;
31
+ } , KILL_PROCESS_EVERY_MS ) ;
32
+
21
33
// first we make sure the bootstrap index has the correct settings
22
34
log . info ( '💪 Setting up Algolia' ) ;
23
35
const {
You can’t perform that action at this time.
0 commit comments