@@ -39,6 +39,9 @@ const {
3939 PDFBufferUnderElectronCreationError,
4040 PDFBufferUnderFrameworkCreationError
4141} = require ( '@bitfinex/bfx-report/workers/loc.api/errors' )
42+ const QUEUE_EVENT_NAMES = require (
43+ '@bitfinex/bfx-report/workers/loc.api/queue/queue.event.names'
44+ )
4245
4346const appDeps = require ( './loc.api/di/app.deps' )
4447const TYPES = require ( './loc.api/di/types' )
@@ -208,7 +211,7 @@ class WrkReportFrameWorkApi extends WrkReportServiceApi {
208211
209212 await wsTransport . start ( )
210213
211- processorQueue . on ( 'error:base' , ( err , job ) => {
214+ processorQueue . on ( QUEUE_EVENT_NAMES . ERROR_BASE , ( err , job ) => {
212215 if (
213216 ! ( err instanceof PDFBufferUnderElectronCreationError ) &&
214217 ! ( err instanceof PDFBufferUnderFrameworkCreationError )
@@ -223,7 +226,7 @@ class WrkReportFrameWorkApi extends WrkReportServiceApi {
223226 this . logger . error ( `WS_EVENT_EMITTER:REPORT_FILE_FAILED: ${ err . stack || err } ` )
224227 } )
225228 } )
226- aggregatorQueue . on ( 'completed' , ( res ) => {
229+ aggregatorQueue . on ( QUEUE_EVENT_NAMES . COMPLETED , ( res ) => {
227230 const {
228231 reportFilesMetadata,
229232 csvFilesMetadata, // For compatibility with old implementation
0 commit comments