mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: 优化任务分配逻辑
This commit is contained in:
1 parent
cafb3b03e5
commit
5671eb0843
3 files changed
+30
-5
No files matched your search
@@ -193,3 +193,11 @@ export function buildProjection(fields: string[]): Record<string, 1> {
|
||||
for (const k of fields) o[k] = 1;
|
||||
return o;
|
||||
}
|
||||
|
||||
export function sleep(timeout: number) {
|
||||
return new Promise((resolve) => {
|
||||
setTimeout(() => {
|
||||
resolve();
|
||||
}, timeout);
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user