Remove duplicated code

This commit is contained in:
peaklabs-dev
2024-09-17 14:43:02 +02:00
parent 4ac2758d70
commit 2bc74c75e1
2 changed files with 10 additions and 21 deletions

View File

@@ -19,8 +19,9 @@ class CleanupSshKeysJob implements ShouldQueue
$oneWeekAgo = Carbon::now()->subWeek();
PrivateKey::where('created_at', '<', $oneWeekAgo)
->whereDoesntHave('gitSources')
->whereDoesntHave('servers')
->delete();
->get()
->each(function ($privateKey) {
$privateKey->safeDelete();
});
}
}
}