mirror of
https://github.com/whyour/qinglong.git
synced 2026-07-01 04:40:38 +08:00
重构任务执行逻辑
This commit is contained in:
@@ -232,6 +232,14 @@ export async function fileExist(file: any) {
|
||||
});
|
||||
}
|
||||
|
||||
export async function createFile(file: string, data: string = '') {
|
||||
return new Promise((resolve) => {
|
||||
fs.mkdirSync(path.dirname(file), { recursive: true });
|
||||
fs.writeFileSync(file, data);
|
||||
resolve(true);
|
||||
});
|
||||
}
|
||||
|
||||
export async function concurrentRun(
|
||||
fnList: Array<() => Promise<any>> = [],
|
||||
max = 5,
|
||||
|
||||
Reference in New Issue
Block a user