Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit f25d4a0

Browse files
author
sachin-maheshwari
authored
Merge pull request #12 from topcoder-platform/develop
Shapeup#2 user fortification - fix async sleep function calling
2 parents fbda9af + 021cf51 commit f25d4a0

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/services/ProcessorService.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,24 +58,24 @@ async function processCreate (message, ubahnToken) {
5858

5959
const userId = await helper.createUser(_.pick(message.payload, 'handle', 'firstName', 'lastName'), ubahnToken)
6060
logger.info(`user: ${message.payload.handle} created`)
61-
helper.sleep()
61+
await helper.sleep()
6262
await helper.createExternalProfile(userId, {
6363
organizationId,
6464
uri: `${config.MEMBER_PROFILE_URL_PREFIX}${message.payload.handle}`,
6565
externalId: message.payload.id,
6666
isInactive: !message.payload.active
6767
}, ubahnToken)
6868
logger.info(`external profile: ${organizationId} created`)
69-
helper.sleep()
69+
await helper.sleep()
7070
await helper.createUserAttribute(userId, _.get(attributes, 'isAvailable'), message.payload.active.toString(), ubahnToken)
7171
logger.info('user attribute: isAvailable created')
72-
helper.sleep()
72+
await helper.sleep()
7373
await helper.createUserAttribute(userId, _.get(attributes, 'company'), 'Topcoder', ubahnToken)
7474
logger.info('user attribute: company created')
75-
helper.sleep()
75+
await helper.sleep()
7676
await helper.createUserAttribute(userId, _.get(attributes, 'title'), 'Member', ubahnToken)
7777
logger.info('user attribute: title created')
78-
helper.sleep()
78+
await helper.sleep()
7979
await helper.createUserAttribute(userId, _.get(attributes, 'location'), location, ubahnToken)
8080
logger.info('user attribute: location created')
8181

0 commit comments

Comments
 (0)