fix: make sure resources are deleted in async mode

This commit is contained in:
Andras Bacsai
2024-02-08 13:10:29 +01:00
parent 548304765c
commit 23d121d67a
5 changed files with 88 additions and 78 deletions

View File

@@ -19,6 +19,7 @@ use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\Artisan;
class DeleteResourceJob implements ShouldQueue, ShouldBeEncrypted
{
@@ -49,8 +50,11 @@ class DeleteResourceJob implements ShouldQueue, ShouldBeEncrypted
break;
}
} catch (\Throwable $e) {
ray($e->getMessage());
send_internal_notification('ContainerStoppingJob failed with: ' . $e->getMessage());
throw $e;
} finally {
Artisan::queue('cleanup:stucked-resources');
}
}
}