11import { Worker } from './worker' ;
22import * as WorkerNames from './workerNames' ;
33import { GroupWorkerTask } from 'hawk-worker-grouper/types/group-worker-task' ;
4- import { CatcherMessageType , CatcherMessagePayload , CatcherMessageAccepted } from '@hawk.so/types'
4+ import { CatcherMessageType , CatcherMessagePayload , CatcherMessageAccepted , ErrorsCatcherType } from '@hawk.so/types'
55
66/**
77 * Defines a Worker that handles events from Catcher.
@@ -12,7 +12,7 @@ export abstract class EventWorker extends Worker {
1212 * Worker type (will pull tasks from Registry queue with the same name)
1313 * 'errors/nodejs' for example
1414 */
15- public type : CatcherMessageType ;
15+ public type : ErrorsCatcherType ;
1616
1717 /**
1818 * Message handle function
@@ -25,9 +25,9 @@ export abstract class EventWorker extends Worker {
2525 await this . addTask ( WorkerNames . GROUPER , {
2626 projectId : task . projectId ,
2727 catcherType : this . type as CatcherMessageType ,
28- payload : task . payload as CatcherMessagePayload < typeof this . type > ,
28+ payload : task . payload as CatcherMessagePayload < ErrorsCatcherType > ,
2929 timestamp : task . timestamp
30- } as GroupWorkerTask < typeof this . type > ) ;
30+ } as GroupWorkerTask < ErrorsCatcherType > ) ;
3131 }
3232
3333 /**
0 commit comments