fix: db/service start should be on high queue

This commit is contained in:
Andras Bacsai
2024-11-06 12:30:10 +01:00
parent 47cd8f9e13
commit 0aa2ba6923
4 changed files with 15 additions and 15 deletions

View File

@@ -1203,7 +1203,7 @@ class ApplicationsController extends Controller
$service->name = "service-$service->uuid";
$service->parse(isNew: true);
if ($instantDeploy) {
StartService::dispatch($service);
StartService::dispatch($service)->onQueue('high');
}
return response()->json(serializeApiResponse([

View File

@@ -1151,7 +1151,7 @@ class DatabasesController extends Controller
}
$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 @@ class DatabasesController extends Controller
}
$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 @@ class DatabasesController extends Controller
}
$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 @@ class DatabasesController extends Controller
}
$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 @@ class DatabasesController extends Controller
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 @@ class DatabasesController extends Controller
}
$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 @@ class DatabasesController extends Controller
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 @@ class DatabasesController extends Controller
}
$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 @@ class DatabasesController extends Controller
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 @@ class DatabasesController extends Controller
if (! $database) {
return response()->json(['message' => 'Database not found.'], 404);
}
RestartDatabase::dispatch($database);
RestartDatabase::dispatch($database)->onQueue('high');
return response()->json(
[

View File

@@ -307,7 +307,7 @@ class DeployController extends Controller
break;
default:
// Database resource
StartDatabase::dispatch($resource);
StartDatabase::dispatch($resource)->onQueue('high');
$resource->update([
'started_at' => now(),
]);

View File

@@ -342,7 +342,7 @@ class ServicesController extends Controller
}
$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 @@ class ServicesController extends Controller
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 @@ class ServicesController extends Controller
if (! $service) {
return response()->json(['message' => 'Service not found.'], 404);
}
RestartService::dispatch($service);
RestartService::dispatch($service)->onQueue('high');
return response()->json(
[