Skip to content

Commit 82509aa

Browse files
committed
🐛Fix migration trigger
1 parent fdec463 commit 82509aa

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

php/EE/Runner.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -868,6 +868,18 @@ 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+
return;
879+
}
880+
881+
$cache->write( 'migration_running', true );
882+
871883
$db_version = Option::get( 'version' );
872884
$current_version = EE_VERSION;
873885

@@ -899,6 +911,8 @@ private function maybe_trigger_migration() {
899911
} elseif ( false !== strpos( $current_version, 'nightly' ) ) {
900912
$this->trigger_migration( $current_version );
901913
}
914+
915+
$cache->remove( 'migration_running' );
902916
}
903917

904918
private function trigger_migration( $version ) {

0 commit comments

Comments
 (0)