Fix for infinite refreshing

This commit is contained in:
Hubert Walczak
2023-07-09 12:03:15 +02:00
parent cbd343e369
commit f560ddf7be
+2
View File
@@ -19,6 +19,7 @@
// make sure we only run the automation script once and wait until it's done, // make sure we only run the automation script once and wait until it's done,
// so concurrent AJAX calls from many different users won't overload the server // so concurrent AJAX calls from many different users won't overload the server
if ( !defined('AUTOMATION_MANUAL_RUN') ) { if ( !defined('AUTOMATION_MANUAL_RUN') ) {
if(defined('AUTOMATION_LOCK_FILE_NAME')){
if ( file_exists( AUTOMATION_LOCK_FILE_NAME ) ) { if ( file_exists( AUTOMATION_LOCK_FILE_NAME ) ) {
// check that the file is not too old, in which case our PHP script hung // check that the file is not too old, in which case our PHP script hung
// and we need to remove the lock and run automation again // and we need to remove the lock and run automation again
@@ -35,6 +36,7 @@ if ( !defined('AUTOMATION_MANUAL_RUN') ) {
// create automation lock file // create automation lock file
file_put_contents( AUTOMATION_LOCK_FILE_NAME, '' ); file_put_contents( AUTOMATION_LOCK_FILE_NAME, '' );
} }
}
} }
include_once("Database.php"); include_once("Database.php");