Skip to content

Commit f5dd32c

Browse files
minor clean up
1 parent 182b5ca commit f5dd32c

File tree

4 files changed

+1
-54
lines changed

4 files changed

+1
-54
lines changed

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ if not provided, then SSL connection is not used, direct insecure connection is
5757
- AUTH0_CLIENT_SECRET: Auth0 client secret for M2M token
5858
- IS_CREATE_FORUM: Should create forum resource or not
5959
- CHALLENGE_ORIGINATOR: originator from challenge service
60-
- CHALLENGE_USER_UNREGISTRATION_TOPIC: unregistration topic from challenge service
61-
- CHALLENGE_USER_REGISTRATION_TOPIC: registration topic from challenge service
6260

6361
Also note that there is a `/health` endpoint that checks for the health of the app. This sets up an expressjs server and listens on the environment variable `PORT`. It's not part of the configuration file and needs to be passed as an environment variable
6462

config/default.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ module.exports = {
2828
DELETE_CHALLENGE_RESOURCE_TOPIC: process.env.DELETE_CHALLENGE_RESOURCE_TOPIC || 'challenge.action.resource.delete',
2929

3030
CHALLENGE_ORIGINATOR: process.env.CHALLENGE_ORIGINATOR || 'app.challenge.service',
31-
CHALLENGE_USER_UNREGISTRATION_TOPIC: process.env.CHALLENGE_USER_UNREGISTRATION_TOPIC || 'notifications.kafka.queue.java.test',
32-
CHALLENGE_USER_REGISTRATION_TOPIC: process.env.CHALLENGE_USER_REGISTRATION_TOPIC || 'notifications.kafka.queue.java.test',
3331

3432
CHALLENGE_API_V4_URL: process.env.CHALLENGE_API_V4_URL || 'https://api.topcoder-dev.com/v4/challenges',
3533
CHALLENGE_API_V5_URL: process.env.CHALLENGE_API_V5_URL || 'http://localhost:3001/v5/challenges',
@@ -50,7 +48,7 @@ module.exports = {
5048
DB_LOCALE: process.env.INFORMIX_DB_LOCALE || 'en_US.57372',
5149
USER: process.env.INFORMIX_USER || 'informix', // user
5250
PASSWORD: process.env.INFORMIX_PASSWORD || '1nf0rm1x', // password
53-
POOL_MAX_SIZE: parseInt(process.env.MAXPOOL, 10) || 60,
51+
POOL_MAX_SIZE: parseInt(process.env.INFORMIX_POOL_MAX_SIZE, 10) || 60,
5452
maxsize: parseInt(process.env.MAXSIZE) || 0,
5553
minpool: parseInt(process.env.MINPOOL, 10) || 1,
5654
idleTimeout: parseInt(process.env.IDLETIMEOUT, 10) || 3600,

src/services/ResourceDirectManager.js

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
const ProjectServices = require('./ProjectService')
22
const RegistrationDAO = require('../dao/RegistrationDAO')
33
const config = require('config')
4-
const helper = require('../common/helper')
54
const SequenceDAO = require('../dao/SequenceDAO')
65
const Constants = require('../constants')
76
const ForumsWrapper = require('../dao/ForumWrapper')
@@ -153,7 +152,6 @@ async function removeRole (operatorId, contestId, roleId, userId, phase, addNoti
153152
*/
154153
async function addResource (operatorId, challengeId, resourceRoleId, isStudio) {
155154
await assignRole(operatorId, challengeId, resourceRoleId, operatorId, null, false, false, isStudio, false)
156-
await fireEvent('ADD_RESOURCE', challengeId, operatorId, resourceRoleId, operatorId, isStudio)
157155
}
158156

159157
/**
@@ -166,31 +164,6 @@ async function addResource (operatorId, challengeId, resourceRoleId, isStudio) {
166164
*/
167165
async function removeResource (operatorId, challengeId, resourceRoleId, isStudio) {
168166
await removeRole(operatorId, challengeId, resourceRoleId, operatorId, null, false, false, isStudio, false)
169-
await fireEvent('REMOVE_RESOURCE', challengeId, operatorId, resourceRoleId, operatorId, isStudio)
170-
}
171-
172-
/**
173-
* Fire event
174-
*
175-
* @param type the message type
176-
* @param challengeId the challengeId to use
177-
* @param userId the user id
178-
* @param resourceRoleId the user id
179-
* @param operatorId the user id
180-
* @param isStudio is studio or not
181-
*/
182-
async function fireEvent (type, challengeId, userId, resourceRoleId, operatorId, isStudio) {
183-
const message = {
184-
type,
185-
detail: {
186-
challengeId,
187-
userId,
188-
resourceRoleId,
189-
operatorId,
190-
isStudio
191-
}
192-
}
193-
await helper.postBusEvent(config.CHALLENGE_USER_UNREGISTRATION_TOPIC, message)
194167
}
195168

196169
module.exports = {

src/services/UnRegistrationManager.js

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
const UnRegistrationDAO = require('../dao/UnRegistrationDAO')
22
const logger = require('../common/logger')
3-
const helper = require('../common/helper')
4-
const config = require('../../config/default')
53
const Constants = require('../constants')
64
const ForumWrapper = require('../dao/ForumWrapper')
75
const EsFeederServiceClient = require('../client/EsFeederServiceClient')
@@ -64,29 +62,9 @@ async function unregisterChallenge (userId, challengeId) {
6462
}
6563
}
6664
}
67-
// TODO: implement following logic in nodejs
68-
await fireEvent(challengeId, userId)
69-
logger.info('notify es es')
7065
await EsFeederServiceClient.notifyChallengeChange(challengeId)
7166
}
7267

73-
/**
74-
* Fire event
75-
*
76-
* @param challengeId the challengeId to use
77-
* @param userId the user id
78-
*/
79-
async function fireEvent (challengeId, userId) {
80-
const message = {
81-
type: 'USER_UNREGISTRATION',
82-
detail: {
83-
challengeId,
84-
userId
85-
}
86-
}
87-
await helper.postBusEvent(config.CHALLENGE_USER_UNREGISTRATION_TOPIC, message)
88-
}
89-
9068
module.exports = {
9169
unregisterChallenge
9270
}

0 commit comments

Comments
 (0)