From f2bcbef07287497afb72cd4d1c2bd81ebe421768 Mon Sep 17 00:00:00 2001 From: dena Date: Thu, 20 Nov 2025 16:24:35 +0100 Subject: [PATCH] move job dispatching out of transaction --- app/Http/Controllers/WikiController.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/Http/Controllers/WikiController.php b/app/Http/Controllers/WikiController.php index b54eed5d8..79bfa0dbe 100644 --- a/app/Http/Controllers/WikiController.php +++ b/app/Http/Controllers/WikiController.php @@ -71,7 +71,7 @@ public function create(Request $request): \Illuminate\Http\Response { $dbAssignment = null; // TODO create with some sort of owner etc? - DB::transaction(function () use ($user, $request, &$wiki, &$dbAssignment, $isSubdomain, $submittedDomain, $rawProfile) { + DB::transaction(function () use ($user, $request, &$wiki, &$dbAssignment, $submittedDomain, $rawProfile) { $dbVersion = Config::get('wbstack.wiki_db_use_version'); $wikiDbCondition = ['wiki_id' => null, 'version' => $dbVersion]; @@ -161,15 +161,15 @@ public function create(Request $request): \Illuminate\Http\Response { if ($rawProfile) { WikiProfile::create(['wiki_id' => $wiki->id, ...$rawProfile]); } - - // TODO maybe always make these run in a certain order..? - dispatch(new MediawikiInit($wiki->domain, $request->input('username'), $user->email)); - // Only dispatch a job to add a k8s ingress IF we are using a custom domain... - if (!$isSubdomain) { - dispatch(new KubernetesIngressCreate($wiki->id, $wiki->domain)); - } }); + // TODO maybe always make these run in a certain order..? + dispatch(new MediawikiInit($wiki->domain, $request->input('username'), $user->email)); + // Only dispatch a job to add a k8s ingress IF we are using a custom domain... + if (!$isSubdomain) { + dispatch(new KubernetesIngressCreate($wiki->id, $wiki->domain)); + } + // dispatch elasticsearch init job to enable the feature if (Config::get('wbstack.elasticsearch_enabled_by_default')) { if ($clusterWithoutSharedIndex) {