diff --git a/backend/src/schedule/MangaUpdateCacheRenewJob.ts b/backend/src/schedule/MangaUpdatesCacheRenewJob.ts similarity index 61% rename from backend/src/schedule/MangaUpdateCacheRenewJob.ts rename to backend/src/schedule/MangaUpdatesCacheRenewJob.ts index 37718b9..d82038e 100644 --- a/backend/src/schedule/MangaUpdateCacheRenewJob.ts +++ b/backend/src/schedule/MangaUpdatesCacheRenewJob.ts @@ -1,13 +1,13 @@ import IJob from './IJob'; -import MangaUpdateCacheRenewService from '../service/MangaUpdateCacheRenewService.js'; +import MangaUpdatesCacheRenewService from '../service/MangaUpdatesCacheRenewService'; import {MangaUpdatesCache} from '../cache/MangaUpdatesCache.js'; -export default class MangaUpdateCacheRenewJob implements IJob { - private readonly service: MangaUpdateCacheRenewService; +export default class MangaUpdatesCacheRenewJob implements IJob { + private readonly service: MangaUpdatesCacheRenewService; private lock: boolean = false; constructor(cache: MangaUpdatesCache) { - this.service = new MangaUpdateCacheRenewService(cache); + this.service = new MangaUpdatesCacheRenewService(cache); } get schedule(): Date | string { diff --git a/backend/src/schedule/Scheduler.ts b/backend/src/schedule/Scheduler.ts index c33920f..dc1b621 100644 --- a/backend/src/schedule/Scheduler.ts +++ b/backend/src/schedule/Scheduler.ts @@ -1,6 +1,6 @@ import {MangaUpdatesCache} from '../cache/MangaUpdatesCache.js'; import IJob from './IJob.js'; -import MangaUpdateCacheRenewJob from './MangaUpdateCacheRenewJob.js'; +import MangaUpdatesCacheRenewJob from './MangaUpdatesCacheRenewJob'; import {gracefulShutdown, scheduleJob} from 'node-schedule'; import {MangaDexCache} from '../cache/MangaDexCache'; import MangaDexCacheRenewJob from './MangaDexCacheRenewJob'; @@ -11,7 +11,7 @@ export default class Scheduler { constructor(mangaDexCache: MangaDexCache, mangaUpdatesCache: MangaUpdatesCache) { this.jobs.push( new MangaDexCacheRenewJob(mangaDexCache), - new MangaUpdateCacheRenewJob(mangaUpdatesCache), + new MangaUpdatesCacheRenewJob(mangaUpdatesCache), ); } diff --git a/backend/src/service/MangaUpdateCacheRenewService.ts b/backend/src/service/MangaUpdatesCacheRenewService.ts similarity index 87% rename from backend/src/service/MangaUpdateCacheRenewService.ts rename to backend/src/service/MangaUpdatesCacheRenewService.ts index 4848ac1..02224ef 100644 --- a/backend/src/service/MangaUpdateCacheRenewService.ts +++ b/backend/src/service/MangaUpdatesCacheRenewService.ts @@ -1,6 +1,6 @@ import {MangaUpdatesCache} from '../cache/MangaUpdatesCache'; -export default class MangaUpdateCacheRenewService { +export default class MangaUpdatesCacheRenewService { private static readonly delay = 3000; private readonly cache: MangaUpdatesCache; @@ -22,7 +22,7 @@ export default class MangaUpdateCacheRenewService { console.log(titles.length + ' out-of-date relations'); for (let title of titles) { - await new Promise((r) => setTimeout(r, MangaUpdateCacheRenewService.delay)); + await new Promise((r) => setTimeout(r, MangaUpdatesCacheRenewService.delay)); try { const fromApi = await fetch('https://api.mangaupdates.com/v1/series/search', { method: 'POST', @@ -49,7 +49,7 @@ export default class MangaUpdateCacheRenewService { console.log(ids.length + ' out-of-date series'); for (let id of ids) { - await new Promise((r) => setTimeout(r, MangaUpdateCacheRenewService.delay)); + await new Promise((r) => setTimeout(r, MangaUpdatesCacheRenewService.delay)); try { const fromApi = await fetch('https://api.mangaupdates.com/v1/series/' + id); if (fromApi.status !== 200) { @@ -69,7 +69,7 @@ export default class MangaUpdateCacheRenewService { console.log(ids.length + ' out-of-date series updates'); for (let id of ids) { - await new Promise((r) => setTimeout(r, MangaUpdateCacheRenewService.delay)); + await new Promise((r) => setTimeout(r, MangaUpdatesCacheRenewService.delay)); try { const fromApi = await fetch('https://api.mangaupdates.com/v1/series/' + id + '/groups'); if (fromApi.status !== 200) {