This commit is contained in:
Prospress Inc
2016-09-08 09:19:32 +02:00
committed by I
parent 084aa2976e
commit 3c13d0a95f
26 changed files with 776 additions and 483 deletions

View File

@@ -16,7 +16,7 @@ class ActionScheduler_QueueCleaner {
public function delete_old_actions() {
$lifespan = apply_filters( 'action_scheduler_retention_period', $this->month_in_seconds );
$cutoff = new DateTime($lifespan.' seconds ago');
$cutoff = as_get_datetime_object($lifespan.' seconds ago');
$actions_to_delete = $this->store->query_actions( array(
'status' => ActionScheduler_Store::STATUS_COMPLETE,
@@ -35,7 +35,7 @@ class ActionScheduler_QueueCleaner {
if ( $timeout < 0 ) {
return;
}
$cutoff = new DateTime($timeout.' seconds ago');
$cutoff = as_get_datetime_object($timeout.' seconds ago');
$actions_to_reset = $this->store->query_actions( array(
'status' => ActionScheduler_Store::STATUS_PENDING,
'modified' => $cutoff,
@@ -55,7 +55,7 @@ class ActionScheduler_QueueCleaner {
if ( $timeout < 0 ) {
return;
}
$cutoff = new DateTime($timeout.' seconds ago');
$cutoff = as_get_datetime_object($timeout.' seconds ago');
$actions_to_reset = $this->store->query_actions( array(
'status' => ActionScheduler_Store::STATUS_RUNNING,
'modified' => $cutoff,