fix: db/service start should be on high queue
This commit is contained in:
parent
47cd8f9e13
commit
0aa2ba6923
4 changed files with 15 additions and 15 deletions
|
|
@ -1203,7 +1203,7 @@ private function create_application(Request $request, $type)
|
|||
$service->name = "service-$service->uuid";
|
||||
$service->parse(isNew: true);
|
||||
if ($instantDeploy) {
|
||||
StartService::dispatch($service);
|
||||
StartService::dispatch($service)->onQueue('high');
|
||||
}
|
||||
|
||||
return response()->json(serializeApiResponse([
|
||||
|
|
|
|||
|
|
@ -1151,7 +1151,7 @@ public function create_database(Request $request, NewDatabaseTypes $type)
|
|||
}
|
||||
$database = create_standalone_postgresql($environment->id, $destination->uuid, $request->all());
|
||||
if ($instantDeploy) {
|
||||
StartDatabase::dispatch($database);
|
||||
StartDatabase::dispatch($database)->onQueue('high');
|
||||
}
|
||||
$database->refresh();
|
||||
$payload = [
|
||||
|
|
@ -1206,7 +1206,7 @@ public function create_database(Request $request, NewDatabaseTypes $type)
|
|||
}
|
||||
$database = create_standalone_mariadb($environment->id, $destination->uuid, $request->all());
|
||||
if ($instantDeploy) {
|
||||
StartDatabase::dispatch($database);
|
||||
StartDatabase::dispatch($database)->onQueue('high');
|
||||
}
|
||||
|
||||
$database->refresh();
|
||||
|
|
@ -1264,7 +1264,7 @@ public function create_database(Request $request, NewDatabaseTypes $type)
|
|||
}
|
||||
$database = create_standalone_mysql($environment->id, $destination->uuid, $request->all());
|
||||
if ($instantDeploy) {
|
||||
StartDatabase::dispatch($database);
|
||||
StartDatabase::dispatch($database)->onQueue('high');
|
||||
}
|
||||
|
||||
$database->refresh();
|
||||
|
|
@ -1320,7 +1320,7 @@ public function create_database(Request $request, NewDatabaseTypes $type)
|
|||
}
|
||||
$database = create_standalone_redis($environment->id, $destination->uuid, $request->all());
|
||||
if ($instantDeploy) {
|
||||
StartDatabase::dispatch($database);
|
||||
StartDatabase::dispatch($database)->onQueue('high');
|
||||
}
|
||||
|
||||
$database->refresh();
|
||||
|
|
@ -1357,7 +1357,7 @@ public function create_database(Request $request, NewDatabaseTypes $type)
|
|||
removeUnnecessaryFieldsFromRequest($request);
|
||||
$database = create_standalone_dragonfly($environment->id, $destination->uuid, $request->all());
|
||||
if ($instantDeploy) {
|
||||
StartDatabase::dispatch($database);
|
||||
StartDatabase::dispatch($database)->onQueue('high');
|
||||
}
|
||||
|
||||
return response()->json(serializeApiResponse([
|
||||
|
|
@ -1406,7 +1406,7 @@ public function create_database(Request $request, NewDatabaseTypes $type)
|
|||
}
|
||||
$database = create_standalone_keydb($environment->id, $destination->uuid, $request->all());
|
||||
if ($instantDeploy) {
|
||||
StartDatabase::dispatch($database);
|
||||
StartDatabase::dispatch($database)->onQueue('high');
|
||||
}
|
||||
|
||||
$database->refresh();
|
||||
|
|
@ -1442,7 +1442,7 @@ public function create_database(Request $request, NewDatabaseTypes $type)
|
|||
removeUnnecessaryFieldsFromRequest($request);
|
||||
$database = create_standalone_clickhouse($environment->id, $destination->uuid, $request->all());
|
||||
if ($instantDeploy) {
|
||||
StartDatabase::dispatch($database);
|
||||
StartDatabase::dispatch($database)->onQueue('high');
|
||||
}
|
||||
|
||||
$database->refresh();
|
||||
|
|
@ -1500,7 +1500,7 @@ public function create_database(Request $request, NewDatabaseTypes $type)
|
|||
}
|
||||
$database = create_standalone_mongodb($environment->id, $destination->uuid, $request->all());
|
||||
if ($instantDeploy) {
|
||||
StartDatabase::dispatch($database);
|
||||
StartDatabase::dispatch($database)->onQueue('high');
|
||||
}
|
||||
|
||||
$database->refresh();
|
||||
|
|
@ -1666,7 +1666,7 @@ public function action_deploy(Request $request)
|
|||
if (str($database->status)->contains('running')) {
|
||||
return response()->json(['message' => 'Database is already running.'], 400);
|
||||
}
|
||||
StartDatabase::dispatch($database);
|
||||
StartDatabase::dispatch($database)->onQueue('high');
|
||||
|
||||
return response()->json(
|
||||
[
|
||||
|
|
@ -1815,7 +1815,7 @@ public function action_restart(Request $request)
|
|||
if (! $database) {
|
||||
return response()->json(['message' => 'Database not found.'], 404);
|
||||
}
|
||||
RestartDatabase::dispatch($database);
|
||||
RestartDatabase::dispatch($database)->onQueue('high');
|
||||
|
||||
return response()->json(
|
||||
[
|
||||
|
|
|
|||
|
|
@ -307,7 +307,7 @@ public function deploy_resource($resource, bool $force = false): array
|
|||
break;
|
||||
default:
|
||||
// Database resource
|
||||
StartDatabase::dispatch($resource);
|
||||
StartDatabase::dispatch($resource)->onQueue('high');
|
||||
$resource->update([
|
||||
'started_at' => now(),
|
||||
]);
|
||||
|
|
|
|||
|
|
@ -342,7 +342,7 @@ public function create_service(Request $request)
|
|||
}
|
||||
$service->parse(isNew: true);
|
||||
if ($instantDeploy) {
|
||||
StartService::dispatch($service);
|
||||
StartService::dispatch($service)->onQueue('high');
|
||||
}
|
||||
$domains = $service->applications()->get()->pluck('fqdn')->sort();
|
||||
$domains = $domains->map(function ($domain) {
|
||||
|
|
@ -1076,7 +1076,7 @@ public function action_deploy(Request $request)
|
|||
if (str($service->status())->contains('running')) {
|
||||
return response()->json(['message' => 'Service is already running.'], 400);
|
||||
}
|
||||
StartService::dispatch($service);
|
||||
StartService::dispatch($service)->onQueue('high');
|
||||
|
||||
return response()->json(
|
||||
[
|
||||
|
|
@ -1229,7 +1229,7 @@ public function action_restart(Request $request)
|
|||
if (! $service) {
|
||||
return response()->json(['message' => 'Service not found.'], 404);
|
||||
}
|
||||
RestartService::dispatch($service);
|
||||
RestartService::dispatch($service)->onQueue('high');
|
||||
|
||||
return response()->json(
|
||||
[
|
||||
|
|
|
|||
Loading…
Reference in a new issue