Better cleanup routine.

This commit is contained in:
James Cole
2016-02-04 17:22:09 +01:00
parent dd361bb9ad
commit f300287814
2 changed files with 3 additions and 2 deletions

View File

@@ -29,8 +29,7 @@ class ExportJobRepository implements ExportJobRepositoryInterface
{
$dayAgo = Carbon::create()->subDay();
ExportJob::where('created_at', '<', $dayAgo->format('Y-m-d H:i:s'))
->where('status', 'never_started')
// TODO also delete others.
->whereIn('status', ['never_started', 'export_status_finished', 'export_downloaded'])
->delete();
return true;