drewnathanson
08/24/2022, 10:13 PMif ( structKeyExists(url, 'reload') )
{
// Lock the scope
lock scope='application' type='exclusive' timeout=10
{
// Call onApplicationStart() to reload
onApplicationStart();
}
}
Daniel Mejia
08/24/2022, 10:28 PMdrewnathanson
08/24/2022, 10:30 PMrstewart
08/24/2022, 10:33 PMDaniel Mejia
08/24/2022, 10:36 PMAdam Cameron
Adam Cameron
Daniel Mejia
08/24/2022, 10:38 PMDaniel Mejia
08/24/2022, 10:39 PMAdam Cameron
onApplicationStart
causes the application to restart is... mostly OK. However it's a bit of an inelegant way to do it.
Better to stop the application and let it restart when it's ready.
The difference is that simply calling onApplicationStart
will pull the rug out of any currently running requests, which will leave yer application in an unstable state.Adam Cameron
onApplicationStart
yerself does not do this.rstewart
08/24/2022, 10:42 PMDaniel Mejia
08/24/2022, 10:46 PMprivate void function reset(){
application.uniqueid = createUUID();
}
public boolean function onRequestStart(string targetPage){
if( structKeyExists(url,"reset") {
reset();
}
}
rstewart
08/24/2022, 10:47 PMrstewart
08/24/2022, 10:48 PMDaniel Mejia
08/24/2022, 10:51 PMgavinbaumanis
08/25/2022, 1:38 AMchris-schmitz
08/25/2022, 7:56 AMApplicationStop()
and later tries to use something like e.g. an application variable. The same for other requests that had already started when ApplicationStop()
was executed as well, IIRC.gavinbaumanis
08/25/2022, 8:05 AM<cfscript>
applicationStop()
</cfscript>
is the applicationStop() queued BEHIND existing requests - allowing them to finish correctly.
OR does it effect running requests - causing them to lose their APPLICATION settings / vars / etc?Adam Cameron
applicationStop
does not interfere with any other already-running requests on CF (ie: they run to completion with the application instance they started with). On Lucee they break.
Off out to sit in the sun with beer and music right now. Will tidy up my code and post here later (maybe tomorrow)Adam Cameron
gavinbaumanis
08/29/2022, 12:22 AM