Skip to content

Commit 7219f18

Browse files
authored
Merge branch 'develop' into feature/ssl-off
2 parents 531a904 + 5cbb681 commit 7219f18

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

php/EE/Runner.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -868,11 +868,25 @@ private function auto_check_update() {
868868
*/
869869
private function maybe_trigger_migration() {
870870

871+
$cache = EE::get_cache();
872+
873+
/**
874+
* Below condition ensures that running EE::launch() or runcommand()
875+
* in migration file does not trigget migration again.
876+
*/
877+
if ( $cache->read( 'migration_running' ) ) {
878+
EE::debug( 'Not triggering migrations since they seems to already been running.' );
879+
return;
880+
}
881+
882+
$cache->write( 'migration_running', true );
883+
871884
$db_version = Option::get( 'version' );
872885
$current_version = EE_VERSION;
873886

874887
if ( ! $db_version ) {
875888
$this->trigger_migration( $current_version );
889+
$cache->remove( 'migration_running' );
876890

877891
return;
878892
}
@@ -899,6 +913,8 @@ private function maybe_trigger_migration() {
899913
} elseif ( false !== strpos( $current_version, 'nightly' ) ) {
900914
$this->trigger_migration( $current_version );
901915
}
916+
917+
$cache->remove( 'migration_running' );
902918
}
903919

904920
private function trigger_migration( $version ) {

0 commit comments

Comments
 (0)