]> git.localhorst.tv Git - alttp.git/blobdiff - app/Http/Controllers/AosSeedController.php
add aos seed retry button
[alttp.git] / app / Http / Controllers / AosSeedController.php
index 3e3a2b05afcd293acd034bb2bf79f5e2e4daa9b4..9d35bc09fd0fcc44324a94178665f0158c974a9f 100644 (file)
@@ -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();
+       }
+
 }