mirror of
https://github.com/ershisan99/coolify.git
synced 2025-12-16 20:49:28 +00:00
Merge pull request #3509 from coollabsio/delete-unused-ssh-keys
Feat: Delete unused ssh keys button
This commit is contained in:
@@ -1,27 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Jobs;
|
||||
|
||||
use App\Models\PrivateKey;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Carbon\Carbon;
|
||||
|
||||
class CleanupSshKeysJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
public function handle()
|
||||
{
|
||||
$oneWeekAgo = Carbon::now()->subWeek();
|
||||
|
||||
PrivateKey::where('created_at', '<', $oneWeekAgo)
|
||||
->get()
|
||||
->each(function ($privateKey) {
|
||||
$privateKey->safeDelete();
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user