Skip to content

Commit 308c31b

Browse files
Merge pull request #473 from topcoder-platform/revert-470-issue_dup
Revert "Resolve Duplicate Payment issue"
2 parents 8aac674 + 07d5587 commit 308c31b

File tree

3 files changed

+4
-18
lines changed

3 files changed

+4
-18
lines changed

package-lock.json

-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/common/helper.js

+3-8
Original file line numberDiff line numberDiff line change
@@ -764,21 +764,16 @@ function getBusApiClient () {
764764
* Post bus event.
765765
* @param {String} topic the event topic
766766
* @param {Object} payload the event payload
767-
* @param {Object} options the extra options to the message
768767
*/
769-
async function postBusEvent (topic, payload, options = {}) {
768+
async function postBusEvent (topic, payload) {
770769
const client = getBusApiClient()
771-
const message = {
770+
await client.postEvent({
772771
topic,
773772
originator: constants.EVENT_ORIGINATOR,
774773
timestamp: new Date().toISOString(),
775774
'mime-type': constants.EVENT_MIME_TYPE,
776775
payload
777-
}
778-
if (options.key) {
779-
message.key = options.key
780-
}
781-
await client.postEvent(message)
776+
})
782777
}
783778

784779
/**

src/services/ChallengeService.js

+1-5
Original file line numberDiff line numberDiff line change
@@ -1951,11 +1951,7 @@ async function update (currentUser, challengeId, data, isFull) {
19511951

19521952
// post bus event
19531953
logger.debug(`Post Bus Event: ${constants.Topics.ChallengeUpdated} ${JSON.stringify(challenge)}`)
1954-
const options = {}
1955-
if (challenge.status == 'Completed') {
1956-
options.key = `${challenge.id}:${challenge.status}`
1957-
}
1958-
await helper.postBusEvent(constants.Topics.ChallengeUpdated, challenge, options)
1954+
await helper.postBusEvent(constants.Topics.ChallengeUpdated, challenge)
19591955
if (phasesHaveBeenModified === true && _.get(challenge, 'legacy.useSchedulingAPI')) {
19601956
await helper.postBusEvent(config.SCHEDULING_TOPIC, { id: challengeId })
19611957
}

0 commit comments

Comments
 (0)