From 733912624122c2bf3e3fde8f89985d03702311f8 Mon Sep 17 00:00:00 2001 From: lifegpc Date: Thu, 6 Jun 2024 17:13:37 +0800 Subject: [PATCH] Fix bug --- task_manager.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/task_manager.ts b/task_manager.ts index 78f0e08..b74c4f8 100644 --- a/task_manager.ts +++ b/task_manager.ts @@ -177,8 +177,8 @@ export class TaskManager extends EventTarget { async check_task(task: Task) { this.#check_closed(); if (await this.check_task_is_running(task)) return; - const ut = (await this.db.check_onetime_task()).map((t) => t.id); - if (ut.length && !ut.includes(task.id)) return; + const ut = (await this.db.check_onetime_task()).map((t) => BigInt(t.id)); + if (ut.length && !ut.includes(BigInt(task.id))) return; let t = task; if (task.pid != Deno.pid) { const p = await this.db.set_task_pid(t); @@ -342,13 +342,13 @@ export class TaskManager extends EventTarget { base: task, }, ); - } else if (task.type === TaskType.UpdateMeiliSearchData) { + } else if (task.type == TaskType.UpdateMeiliSearchData) { await this.waiting_unfinished_task(); this.running_tasks.set(BigInt(task.id), { task: update_meili_search_data(task, this), base: task, }); - } else if (task.type === TaskType.FixGalleryPage) { + } else if (task.type == TaskType.FixGalleryPage) { await this.waiting_unfinished_task(); this.running_tasks.set(BigInt(task.id), { task: fix_gallery_page(task, this),