PMCORE-2180 Migrate to queue job - Cron File: cron.php - Activity: unpause

This commit is contained in:
Roly Rudy Gutierrez Pinto
2020-09-24 08:25:51 -04:00
committed by Julio Cesar Laura Avendaño
parent ca82c81399
commit ef68bf318b
3 changed files with 54 additions and 25 deletions

View File

@@ -182,4 +182,27 @@ class Task
};
$this->runTask($job);
}
/**
* This unpause applications.
* @param string $now
*/
public function unpauseApplications($now)
{
$job = function() use($now) {
$this->setExecutionMessage("Unpausing applications");
try {
$cases = new \Cases();
$cases->ThrowUnpauseDaemon($now, 1);
$this->setExecutionResultMessage('DONE');
$this->saveLog('unpauseApplications', 'action', 'Unpausing Applications');
} catch (Exception $e) {
$this->setExecutionResultMessage('WITH ERRORS', 'error');
eprintln(" '-" . $e->getMessage(), 'red');
$this->saveLog('unpauseApplications', 'error', 'Error Unpausing Applications: ' . $e->getMessage());
}
};
$this->runTask($job);
}
}