core: fix index creation (#197)

This commit is contained in:
undefined committed 2021-09-12 00:18:46 +08:00
1 parent 62dbd0beb8
commit f5c63e02ce
4 files changed
+10 -6

No files matched your search

+3
View File
@@ -69,7 +69,10 @@ class WorkerService implements BaseService {
async (doc) => {
try {
logger.debug('Worker task: %o', doc);
const start = Date.now();
await this.handlers[doc.subType](doc);
const spent = Date.now() - start;
if (spent > 500) logger.warn('Slow worker task (%d ms): %s', spent, doc);
} catch (e) {
logger.error('Worker task fail: ', e);
logger.error('%o', doc);