Website: Temporarily disable re-freeze logic to troubleshoot website caching issues on 2022-05-03. (#5545)

This commit is contained in:
Mike McNeil
2022-05-03 17:45:25 -05:00
committed by GitHub
parent cc461e0549
commit 137016caee
+22 -18
View File
@@ -277,27 +277,31 @@ module.exports = {
}, baseHeaders);
}
// And also unfreeze and re-freeze to temporarily allow merging.
// [?] https://github.com/fleetdm/fleet/issues/5179
if (isAutoApproved) {
// Temporarily disable re-freeze logic to troubleshoot website caching issues on 2022-05-03.
// (very unlikely this is a culprit, but ruling out race conditions)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// // And also unfreeze and re-freeze to temporarily allow merging.
// // [?] https://github.com/fleetdm/fleet/issues/5179
// if (isAutoApproved) {
let mergeFreezeReport = await sails.helpers.http.get('https://www.mergefreeze.com/api/branches/fleetdm/fleet/main', { access_token: sails.config.custom.mergeFreezeAccessToken });//eslint-disable-line camelcase
if (mergeFreezeReport.frozen) {
await sails.helpers.http.post('https://www.mergefreeze.com/api/branches/fleetdm/fleet/main', { frozen: false, access_token: sails.config.custom.mergeFreezeAccessToken, user_name: 'fleet-release' });//eslint-disable-line camelcase
// let mergeFreezeReport = await sails.helpers.http.get('https://www.mergefreeze.com/api/branches/fleetdm/fleet/main', { access_token: sails.config.custom.mergeFreezeAccessToken });//eslint-disable-line camelcase
// if (mergeFreezeReport.frozen) {
// await sails.helpers.http.post('https://www.mergefreeze.com/api/branches/fleetdm/fleet/main', { frozen: false, access_token: sails.config.custom.mergeFreezeAccessToken, user_name: 'fleet-release' });//eslint-disable-line camelcase
// Then, in the background, 2 minutes later...
setTimeout(()=>{
sails.helpers.http.post('https://www.mergefreeze.com/api/branches/fleetdm/fleet/main', { frozen: true, access_token: sails.config.custom.mergeFreezeAccessToken, user_name: 'fleet-release' })//eslint-disable-line camelcase
.exec((err)=>{
if (err) {
sails.log.error('Background instruction failed: Unexpected error re-freezing repo (see https://github.com/fleetdm/fleet/issues/5179 for background):', err);
}
sails.log.info('Re-freeze completed successfully.');
});//_∏_
}, 2*60*1000);//_∏_
}//fi
// // Then, in the background, 2 minutes later...
// setTimeout(()=>{
// sails.helpers.http.post('https://www.mergefreeze.com/api/branches/fleetdm/fleet/main', { frozen: true, access_token: sails.config.custom.mergeFreezeAccessToken, user_name: 'fleet-release' })//eslint-disable-line camelcase
// .exec((err)=>{
// if (err) {
// sails.log.error('Background instruction failed: Unexpected error re-freezing repo (see https://github.com/fleetdm/fleet/issues/5179 for background):', err);
// }
// sails.log.info('Re-freeze completed successfully.');
// });//_∏_
// }, 2*60*1000);//_∏_
// }//fi
}//fi
// }//fi
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
}
} else if (ghNoun === 'issue_comment' && ['created'].includes(action) && (issueOrPr&&issueOrPr.state === 'open')) {