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

Commit ac57222

Browse files
committed
Cleaning up logging
1 parent f3ea5e5 commit ac57222

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

src/services/ProcessorService.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ async function processUpdate (message) {
393393
logger.info(`GroupIDs Found in Informix: ${JSON.stringify(v4GroupIds)}`)
394394

395395
const saveDraftContestDTO = await parsePayload(message.payload, m2mToken, false, v4GroupIds)
396-
logger.debug('Parsed Payload', saveDraftContestDTO)
396+
// logger.debug('Parsed Payload', saveDraftContestDTO)
397397
try {
398398
await helper.putRequest(`${config.V4_CHALLENGE_API_URL}/${message.payload.legacyId}`, { param: _.omit(saveDraftContestDTO, ['groupsToBeAdded', 'groupsToBeDeleted']) }, m2mToken)
399399
await associateChallengeGroups(saveDraftContestDTO.groupsToBeAdded, saveDraftContestDTO.groupsToBeDeleted, message.payload.legacyId)

src/services/groupsService.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,21 @@ const QUERY_DELETE_CONTEST_ELIGIBILITY = 'DELETE FROM contest_eligibility WHERE
2020
* @return {Object} Informix statement
2121
*/
2222
async function prepare (connection, sql) {
23-
logger.debug(`Preparing SQL ${sql}`)
23+
// logger.debug(`Preparing SQL ${sql}`)
2424
const stmt = await connection.prepareAsync(sql)
2525
return Promise.promisifyAll(stmt)
2626
}
2727

2828
async function getGroupsForChallenge (challengeLegacyId) {
29-
logger.debug(`Getting Groups for Challenge ${challengeLegacyId}`)
29+
// logger.debug(`Getting Groups for Challenge ${challengeLegacyId}`)
3030
const connection = await helper.getInformixConnection()
3131
let groupIds = []
3232
try {
3333
// await connection.beginTransactionAsync()
3434
const eligibilityId = await getChallengeEligibilityId(connection, challengeLegacyId)
3535
if (eligibilityId) {
3636
groupIds = await getGroupIdsForEligibilityId(connection, eligibilityId)
37-
logger.debug(`Groups Found for ${challengeLegacyId} - ${JSON.stringify(groupIds)}`)
37+
// logger.debug(`Groups Found for ${challengeLegacyId} - ${JSON.stringify(groupIds)}`)
3838
}
3939
// logger.debug(`No groups Found for ${challengeLegacyId}`)
4040
// await connection.commitTransactionAsync()
@@ -89,11 +89,11 @@ async function removeGroupFromChallenge (challengeLegacyId, groupLegacyId) {
8989

9090
if (groupEligibilityRecord) {
9191
await deleteGroupEligibilityRecord(connection, eligibilityId, groupLegacyId)
92-
logger.debug('Getting Groups Count')
92+
// logger.debug('Getting Groups Count')
9393
const { groupsCount } = await getCountOfGroupsInEligibilityRecord(connection, eligibilityId)
94-
logger.debug(`${groupsCount} groups exist`)
94+
// logger.debug(`${groupsCount} groups exist`)
9595
if (groupsCount <= 0) {
96-
logger.debug('No groups exist, deleting')
96+
logger.debug('No groups exist, deleting eligibility group')
9797
await deleteEligibilityRecord(connection, eligibilityId)
9898
}
9999
}
@@ -117,9 +117,9 @@ async function removeGroupFromChallenge (challengeLegacyId, groupLegacyId) {
117117
*/
118118
async function getChallengeEligibilityId (connection, challengeLegacyId) {
119119
// get the challenge eligibility record, if one doesn't exist, create it and return the id
120-
logger.info(`getChallengeEligibilityId Query: ${util.format(QUERY_GET_ELIGIBILITY_ID, challengeLegacyId)}`)
120+
// logger.info(`getChallengeEligibilityId Query: ${util.format(QUERY_GET_ELIGIBILITY_ID, challengeLegacyId)}`)
121121
const result = await connection.queryAsync(util.format(QUERY_GET_ELIGIBILITY_ID, challengeLegacyId))
122-
logger.info(`getChallengeEligibilityId Result: ${JSON.stringify(result)}`)
122+
// logger.info(`getChallengeEligibilityId Result: ${JSON.stringify(result)}`)
123123
return (result && result[0]) ? result[0].contest_eligibility_id : false
124124
}
125125

@@ -130,9 +130,9 @@ async function getChallengeEligibilityId (connection, challengeLegacyId) {
130130
* @returns {Object} DB Result
131131
*/
132132
async function groupEligbilityExists (connection, eligibilityId, groupLegacyId) {
133-
logger.debug(`groupEligibiltyExists query ${util.format(QUERY_GET_GROUP_ELIGIBILITY_ID, eligibilityId, groupLegacyId)}`)
133+
// logger.debug(`groupEligibiltyExists query ${util.format(QUERY_GET_GROUP_ELIGIBILITY_ID, eligibilityId, groupLegacyId)}`)
134134
const result = await connection.queryAsync(util.format(QUERY_GET_GROUP_ELIGIBILITY_ID, eligibilityId, groupLegacyId))
135-
logger.debug(`groupEligibiltyExists result ${JSON.stringify(result)} ${JSON.stringify(result[0])}`)
135+
// logger.debug(`groupEligibiltyExists result ${JSON.stringify(result)} ${JSON.stringify(result[0])}`)
136136
return (result && result[0]) || false
137137
}
138138

@@ -181,7 +181,7 @@ async function getCountOfGroupsInEligibilityRecord (connection, eligibilityId) {
181181

182182
async function getGroupIdsForEligibilityId (connection, eligibilityId) {
183183
const query = util.format(QUERY_GET_GROUPS, eligibilityId)
184-
logger.debug(`getGroupIdsForEligibilityId ${query}`)
184+
// logger.debug(`getGroupIdsForEligibilityId ${query}`)
185185
const result = await connection.queryAsync(query)
186186
return _.map(result, r => r.group_id)
187187
}

0 commit comments

Comments
 (0)