UNPKG

ld-scheduler

Version:

Schedule launch darkly flags on or off

15 lines (11 loc) 431 B
import scheduler from './scheduler'; import Logger from './log'; const log = new Logger('cronJob'); const cronJob = ({environment, apiKey, slack, pollIntervalSeconds = 60}) => { log.info(`ld-scheduler started. Polling interval: ${pollIntervalSeconds}s`); scheduler({environment, apiKey, slack}); setInterval(() => { scheduler({environment, apiKey, slack}); }, pollIntervalSeconds * 1000); }; export default cronJob;