Commit 68806a42 authored by Dylan Shields's avatar Dylan Shields Committed by Steven Ayers
Browse files

Issue #3213539 by dshields: When using Migrate Plus, update the "Last imported" date stamp

parent e20e4137
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
<?php

/**
 * @file
 * Contains implementation of cron function to execute scheduled migrations.
@@ -45,6 +46,12 @@ function migrate_scheduler_cron() {
          }
          $executable = new MigrateExecutable($migration, new MigrateMessage());
          $executable->import();
          // If using migrate_plus module, update the migrate_last_imported value for the migration.
          $moduleHandler = \Drupal::service('module_handler');
          if ($moduleHandler->moduleExists('migrate_plus')) {
            $migrate_last_imported_store = \Drupal::keyValue('migrate_last_imported');
            $migrate_last_imported_store->set($migration->id(), round(\Drupal::time()->getCurrentMicroTime() * 1000));
          }
        }
      }
    }