You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
495 B
16 lines
495 B
4 years ago
|
import schedule from 'node-schedule';
|
||
|
import jobPlexSync from './plexsync';
|
||
|
import logger from '../logger';
|
||
|
|
||
|
export const scheduledJobs: Record<string, schedule.Job> = {};
|
||
|
|
||
|
export const startJobs = (): void => {
|
||
|
// Run full plex sync every 6 hours
|
||
|
scheduledJobs.plexFullSync = schedule.scheduleJob('* */6 * * *', () => {
|
||
|
logger.info('Starting scheduled job: Plex Full Sync', { label: 'Jobs' });
|
||
|
jobPlexSync.run();
|
||
|
});
|
||
|
|
||
|
logger.info('Scheduled jobs loaded', { label: 'Jobs' });
|
||
|
};
|