Commit 1d13df0c authored by Eric Rasmussen's avatar Eric Rasmussen
Browse files

Merge remote-tracking branch 'origin/issue-604' into issue-604

parents eb4b8c48 aeb55195
......@@ -296,20 +296,6 @@ EOF;
);
user_save($account, $userData);
}
if ($row->migration_url) {
// If there's a site to migrate, add the job to the queue.
require_once drupal_get_path('module', 'unl_migration') . '/unl_migration.php';
$migration = new Unl_Migration_Tool(
$row->migration_url,
$row->migration_path,
$frontier_config['unl_frontier_username'],
$frontier_config['unl_frontier_password'],
FALSE
);
DrupalQueue::get('unl_migration', TRUE)
->createItem(Unl_Migration_Tool::save_to_disk($migration));
}
}
}
......
......@@ -31,31 +31,3 @@ function unl_migration_permission() {
),
);
}
/**
* Implementation of hook_cron().
*/
function unl_migration_cron() {
_unl_migration_cron_migration_step();
}
/**
* If a site is being migrated via cron jobs, do some work towards that migration.
*/
function _unl_migration_cron_migration_step() {
// We don't want this running as system user, only the web user.
if (PHP_SAPI == 'cli') {
return;
}
$queue = DrupalQueue::get('unl_migration');
if ($queue->numberOfItems() > 0) {
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'unl_migration.php';
$item = $queue->claimItem(120);
$queue->deleteItem($item);
if (unl_migration_queue_step($item->data)) {
module_load_include('module', 'unl_multisite');
_unl_multisite_send_site_created_email();
}
}
}
......@@ -112,16 +112,6 @@ function unl_migration_step($migration, &$context)
$context['sandbox']['duration'] = min(300, ceil($context['sandbox']['duration'] * 1.5));
}
function unl_migration_queue_step($migration_storage_file) {
$migration = Unl_Migration_Tool::load_from_disk($migration_storage_file);
if ($migration->migrate(60)) {
return TRUE;
}
DrupalQueue::get('unl_migration', TRUE)
->createItem(Unl_Migration_Tool::save_to_disk($migration));
return FALSE;
}
class Unl_Migration_Tool
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment