feat: add log function

This commit is contained in:
Gabe Yuan
2024-03-19 18:07:18 +08:00
parent 1d9e9c1b7d
commit 6e927473b9
24 changed files with 76 additions and 41 deletions

View File

@@ -1,3 +1,5 @@
import { kissLog } from "./log";
/**
* 任务池
* @param {*} fn
@@ -35,7 +37,7 @@ export const taskPool = (
const res = await fn({ ...args, ...preArgs });
resolve(res);
} catch (err) {
console.log("[task]", retry, err);
kissLog(err, "task");
if (retry < maxRetry) {
const retryTimer = setTimeout(() => {
clearTimeout(retryTimer);