Skip to content

Commit

Permalink
fix(PruneChangesBeforeJob): Fix delete logic (remove incorrect if) (#21
Browse files Browse the repository at this point in the history
…) (#22)

(cherry picked from commit bfea54a)
  • Loading branch information
silbinarywolf authored May 9, 2018
1 parent 8458919 commit e9dcf76
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions code/jobs/PruneChangesBeforeJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit e9dcf76

Please sign in to comment.