From bfea54a0179b6d11ac25c9f4c439aaeb60a2d960 Mon Sep 17 00:00:00 2001 From: Jake Bentvelzen Date: Thu, 10 May 2018 09:42:04 +1000 Subject: [PATCH] fix(PruneChangesBeforeJob): Fix delete logic (remove incorrect if) (#21) --- code/jobs/PruneChangesBeforeJob.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/code/jobs/PruneChangesBeforeJob.php b/code/jobs/PruneChangesBeforeJob.php index b0238a9..d778249 100644 --- a/code/jobs/PruneChangesBeforeJob.php +++ b/code/jobs/PruneChangesBeforeJob.php @@ -41,13 +41,11 @@ public function getTitle() } public function process() { - if ($this->totalSteps <= 0) { - $items = DataChangeRecord::get()->filter('Created:LessThan', $this->pruneBefore); - $max = $items->max('ID'); - - $query = new SQLDelete('DataChangeRecord', '"ID" < \'' . $max . '\''); - $query->execute(); - } + $items = DataChangeRecord::get()->filter('Created:LessThan', $this->pruneBefore); + $max = $items->max('ID'); + + $query = new SQLDelete('DataChangeRecord', '"ID" < \'' . $max . '\''); + $query->execute(); $job = new PruneChangesBeforeJob($this->priorTo);