Skip to content

Commit 3716995

Browse files
committed
avoid circular dependency
1 parent 59ec92d commit 3716995

File tree

2 files changed

+2
-13
lines changed

2 files changed

+2
-13
lines changed

src/common/helper.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -180,17 +180,6 @@ async function postMessageViaWebhook (webhook, message) {
180180
await request.post(webhook).send(message)
181181
}
182182

183-
/**
184-
* Calls ActionProcessorService to attempt to retry failed process
185-
* @param {String} topic the failed topic name
186-
* @param {Object} payload the payload
187-
* @param {String} retry how many times has it been retried
188-
*/
189-
async function retryFailedProcess (topic, payload, retry) {
190-
const ActionProcessorService = require('../services/ActionProcessorService')
191-
await ActionProcessorService.processCreate(topic, payload, retry)
192-
}
193-
194183
let busApiClient
195184

196185
/**
@@ -242,7 +231,6 @@ module.exports = {
242231
checkEsMutexRelease,
243232
getM2MToken,
244233
postMessageViaWebhook,
245-
retryFailedProcess,
246234
getBusApiClient,
247235
postEvent
248236
}

src/services/WorkPeriodProcessorService.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const constants = require('../common/constants')
99
const config = require('config')
1010
const _ = require('lodash')
1111
const esClient = helper.getESClient()
12+
const ActionProcessorService = require('../services/ActionProcessorService')
1213

1314
/**
1415
* Process create entity message
@@ -31,7 +32,7 @@ async function processCreate (message, transactionId, options) {
3132
// it has not yet been created. We should send a retry request.
3233
if (err.httpStatus === 404) {
3334
logger.logFullError(err, { component: 'WorkPeriodProcessorService', context: 'processCreate' })
34-
await helper.retryFailedProcess(message.topic, workPeriod, options.retry)
35+
await ActionProcessorService.processCreate(message.topic, workPeriod, options.retry)
3536
return
3637
} else {
3738
throw err

0 commit comments

Comments
 (0)