mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-21 01:46:28 +08:00
core: fix error when pid!==displayId
This commit is contained in:
1 parent
7fd31995ab
commit
37ce0a4f66
3 files changed
+21
-16
No files matched your search
@@ -66,9 +66,14 @@ class WorkerService implements BaseService {
|
||||
public start() {
|
||||
this.consumer = new Consumer(
|
||||
{ type: 'schedule', subType: { $in: Object.keys(this.handlers) } },
|
||||
(doc) => {
|
||||
logger.debug('Worker task: %o', doc);
|
||||
return this.handlers[doc.subType](doc);
|
||||
async (doc) => {
|
||||
try {
|
||||
logger.debug('Worker task: %o', doc);
|
||||
await this.handlers[doc.subType](doc);
|
||||
} catch (e) {
|
||||
logger.error('Worker task fail: ', e);
|
||||
logger.error('%o', doc);
|
||||
}
|
||||
},
|
||||
false,
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user