Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Simple request, I want to prevent an email flood during a Migration of data using a hook_mail_alter() call that checks if a migration is currently running and then prevents email from being sent.
What I'd like is a helper function in the Migrate module that returns TRUE or FALSE, or similar, if migrate is currently running.
Comments
Comment #1
mikeryanYou can do what Migrate itself does in its hook_watchdog():
Migration::currentMigration() identifies the migration current running a process if any, returning NULL if there is none running.