refactor: renaming
This commit is contained in:
@@ -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<void> {
|
||||
private readonly service: MangaUpdateCacheRenewService;
|
||||
export default class MangaUpdatesCacheRenewJob implements IJob<void> {
|
||||
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 {
|
||||
@@ -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),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -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) {
|
||||
Reference in New Issue
Block a user