Hi all, I have a couple quick questions about the autodeploy module. We recently installed autodeploy into our app, which was straightforward, however we seem to be consistently getting an error when using the deploy tag.
If I update the deploy tag and then try and hit the site I get an error at /coldbox-4.2.0/system/Bootstrap.cfc: line 468.
If I immediately try to hit the site again the application will immediately load and everything will be fine. I traced the issue into postProcess() and if I comment out the line ‘log.info( “Deploy tag reloaded successfully.” );’
everything works as expected. I’m not sure if this is due to an issue with the way we have logging set up or what. Any suggestions?
Additionally I was looking through the code and noticed that ‘dateCompare( tagTimestamp, appTimestamp ) eq 1’ appears twice but the variables are never updated between checks. Is there something that I’m not understanding about the code that should update these variables? It appears to me as though they will always evaluate the same as they are both function scoped.
`function postProcess( event, interceptData ){
// get the timestamp of the configuration file
var tagTimestamp = fileLastModified( variables.tagFilepath );
// Check if setting exists
if ( settingExists( “_deploytagTimestamp” ) ){
// get current timestamp
var appTimestamp = getSetting( “_deploytagTimestamp” );
//Validate Timestamp
if ( dateCompare( tagTimestamp, appTimestamp ) eq 1 ){
lock scope=“application” type=“exclusive” timeout=“25” throwOntimeout=“true”{
// concurrency lock
if ( dateCompare( tagTimestamp, appTimestamp ) eq 1 ){
try{
// commandobject
if( len( variables.deployCommandObject ) ){
getInstance( variables.deployCommandObject ).execute();
// Log
if( log.canInfo() ){
log.info( “Deploy command object executed!” );
}
}
// Mark Application for shutdown
applicationStop();
// Log Reloading
if( log.canInfo() ){
// the application errors once each time you do a deploy with the deploy tag
// subsequent requests work fine and the application appears to have reloaded
log.info( “Deploy tag reloaded successfully.” );
}
} catch(Any e) {
//Log Error
log.error( “Error in deploy tag: #e.message# #e.detail#”, e.stackTrace );
}
} // end if dateCompare
} //end lock
} // end if dateCompare
// stop interception chain
return true;
} // end if setting exists
else {
configure();
}
}
`
Thanks for the help! It’s greatly appreciated!