core: 优化任务分配逻辑

This commit is contained in:
undefined committed 2020-11-11 13:21:57 +08:00
1 parent cafb3b03e5
commit 5671eb0843
3 files changed
+30 -5

No files matched your search

+8
View File
@@ -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);
});
}