mirror of
https://github.com/sct/overseerr.git
synced 2025-09-17 17:24:35 +02:00
refactor(api): increased plex sync speed and changed full sync to run every 24 hours
With this change, plex sync will now process 20 items at a time every 4 seconds. (About double its previous speed). We will see how much faster we can push this in the future.
This commit is contained in:
@@ -8,7 +8,8 @@ import logger from '../../logger';
|
|||||||
import { getSettings, Library } from '../../lib/settings';
|
import { getSettings, Library } from '../../lib/settings';
|
||||||
import Season from '../../entity/Season';
|
import Season from '../../entity/Season';
|
||||||
|
|
||||||
const BUNDLE_SIZE = 10;
|
const BUNDLE_SIZE = 20;
|
||||||
|
const UPDATE_RATE = 4 * 1000;
|
||||||
|
|
||||||
const imdbRegex = new RegExp(/imdb:\/\/(tt[0-9]+)/);
|
const imdbRegex = new RegExp(/imdb:\/\/(tt[0-9]+)/);
|
||||||
const tmdbRegex = new RegExp(/tmdb:\/\/([0-9]+)/);
|
const tmdbRegex = new RegExp(/tmdb:\/\/([0-9]+)/);
|
||||||
@@ -277,7 +278,7 @@ class JobPlexSync {
|
|||||||
end: end + BUNDLE_SIZE,
|
end: end + BUNDLE_SIZE,
|
||||||
});
|
});
|
||||||
resolve();
|
resolve();
|
||||||
}, 5000)
|
}, UPDATE_RATE)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@ export const startJobs = (): void => {
|
|||||||
// Run recently added plex sync every 5 minutes
|
// Run recently added plex sync every 5 minutes
|
||||||
scheduledJobs.push({
|
scheduledJobs.push({
|
||||||
name: 'Plex Recently Added Sync',
|
name: 'Plex Recently Added Sync',
|
||||||
job: schedule.scheduleJob('0 */10 * * * *', () => {
|
job: schedule.scheduleJob('0 */5 * * * *', () => {
|
||||||
logger.info('Starting scheduled job: Plex Recently Added Sync', {
|
logger.info('Starting scheduled job: Plex Recently Added Sync', {
|
||||||
label: 'Jobs',
|
label: 'Jobs',
|
||||||
});
|
});
|
||||||
@@ -23,7 +23,7 @@ export const startJobs = (): void => {
|
|||||||
// Run full plex sync every 6 hours
|
// Run full plex sync every 6 hours
|
||||||
scheduledJobs.push({
|
scheduledJobs.push({
|
||||||
name: 'Plex Full Library Sync',
|
name: 'Plex Full Library Sync',
|
||||||
job: schedule.scheduleJob('0 0 */6 * * *', () => {
|
job: schedule.scheduleJob('0 0 3 * * *', () => {
|
||||||
logger.info('Starting scheduled job: Plex Full Sync', { label: 'Jobs' });
|
logger.info('Starting scheduled job: Plex Full Sync', { label: 'Jobs' });
|
||||||
jobPlexFullSync.run();
|
jobPlexFullSync.run();
|
||||||
}),
|
}),
|
||||||
|
Reference in New Issue
Block a user