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

mikeryan’s picture

Category: Feature request » Support request
Issue summary: View changes
Status: Active » Fixed

You can do what Migrate itself does in its hook_watchdog():

if (class_exists('Migration') && $migration = Migration::currentMigration()) {
...
}

Migration::currentMigration() identifies the migration current running a process if any, returning NULL if there is none running.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.