-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.js
More file actions
22 lines (16 loc) · 825 Bytes
/
index.js
File metadata and controls
22 lines (16 loc) · 825 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
'use strict'
import { CronJob } from 'cron'
import server from './server'
import { setup as cleanExtracts, extractsRemoverServiceLogger } from './cleanExtracts'
import { setup as expeStats, expeStatsServiceLogger } from './expeStats'
import { imagesPath, deleteExtractsCronTime, expeStatsCronTime } from './config'
const argv = process.argv.slice(2)
new CronJob(expeStatsCronTime, () => expeStats(true), null, true, null, null, false)
expeStatsServiceLogger.info('Started the expe stats service.')
// Start the extracts remover service
if (!argv.includes('--no-delete')) { /* eslint no-new: 0 */
new CronJob(deleteExtractsCronTime, () => cleanExtracts(imagesPath, false, true), null, true, null, null, false)
extractsRemoverServiceLogger.info('Started the extracts remover service.')
}
// Start the server
server()