@@ -20,21 +20,21 @@ const QUERY_DELETE_CONTEST_ELIGIBILITY = 'DELETE FROM contest_eligibility WHERE
20
20
* @return {Object } Informix statement
21
21
*/
22
22
async function prepare ( connection , sql ) {
23
- logger . debug ( `Preparing SQL ${ sql } ` )
23
+ // logger.debug(`Preparing SQL ${sql}`)
24
24
const stmt = await connection . prepareAsync ( sql )
25
25
return Promise . promisifyAll ( stmt )
26
26
}
27
27
28
28
async function getGroupsForChallenge ( challengeLegacyId ) {
29
- logger . debug ( `Getting Groups for Challenge ${ challengeLegacyId } ` )
29
+ // logger.debug(`Getting Groups for Challenge ${challengeLegacyId}`)
30
30
const connection = await helper . getInformixConnection ( )
31
31
let groupIds = [ ]
32
32
try {
33
33
// await connection.beginTransactionAsync()
34
34
const eligibilityId = await getChallengeEligibilityId ( connection , challengeLegacyId )
35
35
if ( eligibilityId ) {
36
36
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)}`)
38
38
}
39
39
// logger.debug(`No groups Found for ${challengeLegacyId}`)
40
40
// await connection.commitTransactionAsync()
@@ -89,11 +89,11 @@ async function removeGroupFromChallenge (challengeLegacyId, groupLegacyId) {
89
89
90
90
if ( groupEligibilityRecord ) {
91
91
await deleteGroupEligibilityRecord ( connection , eligibilityId , groupLegacyId )
92
- logger . debug ( 'Getting Groups Count' )
92
+ // logger.debug('Getting Groups Count')
93
93
const { groupsCount } = await getCountOfGroupsInEligibilityRecord ( connection , eligibilityId )
94
- logger . debug ( `${ groupsCount } groups exist` )
94
+ // logger.debug(`${groupsCount} groups exist`)
95
95
if ( groupsCount <= 0 ) {
96
- logger . debug ( 'No groups exist, deleting' )
96
+ logger . debug ( 'No groups exist, deleting eligibility group ' )
97
97
await deleteEligibilityRecord ( connection , eligibilityId )
98
98
}
99
99
}
@@ -117,9 +117,9 @@ async function removeGroupFromChallenge (challengeLegacyId, groupLegacyId) {
117
117
*/
118
118
async function getChallengeEligibilityId ( connection , challengeLegacyId ) {
119
119
// 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)}`)
121
121
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)}`)
123
123
return ( result && result [ 0 ] ) ? result [ 0 ] . contest_eligibility_id : false
124
124
}
125
125
@@ -130,9 +130,9 @@ async function getChallengeEligibilityId (connection, challengeLegacyId) {
130
130
* @returns {Object } DB Result
131
131
*/
132
132
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)}`)
134
134
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])}`)
136
136
return ( result && result [ 0 ] ) || false
137
137
}
138
138
@@ -181,7 +181,7 @@ async function getCountOfGroupsInEligibilityRecord (connection, eligibilityId) {
181
181
182
182
async function getGroupIdsForEligibilityId ( connection , eligibilityId ) {
183
183
const query = util . format ( QUERY_GET_GROUPS , eligibilityId )
184
- logger . debug ( `getGroupIdsForEligibilityId ${ query } ` )
184
+ // logger.debug(`getGroupIdsForEligibilityId ${query}`)
185
185
const result = await connection . queryAsync ( query )
186
186
return _ . map ( result , r => r . group_id )
187
187
}
0 commit comments