X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=app%2FHttp%2FControllers%2FAosSeedController.php;fp=app%2FHttp%2FControllers%2FAosSeedController.php;h=9d35bc09fd0fcc44324a94178665f0158c974a9f;hb=9fba7a05c1aba4b8d3be892c8b29c604ba4ae484;hp=3e3a2b05afcd293acd034bb2bf79f5e2e4daa9b4;hpb=b905eab9477d46972c3fb09d25ae3bee5480c6d4;p=alttp.git diff --git a/app/Http/Controllers/AosSeedController.php b/app/Http/Controllers/AosSeedController.php index 3e3a2b0..9d35bc0 100644 --- a/app/Http/Controllers/AosSeedController.php +++ b/app/Http/Controllers/AosSeedController.php @@ -2,6 +2,7 @@ namespace App\Http\Controllers; +use App\Jobs\GenerateAosSeed; use App\Models\AosSeed; use Illuminate\Http\Request; @@ -21,4 +22,16 @@ class AosSeedController extends Controller return $seed->toJson(); } + public function retry($hash) { + $seed = AosSeed::where('hash', '=', $hash)->firstOrFail(); + + if ($seed->status == 'error') { + $seed->status = 'pending'; + $seed->save(); + GenerateAosSeed::dispatch($seed)->onConnection('database'); + } + + return $seed->toJson(); + } + }