Skip to content

Commit cc36a0e

Browse files
authored
Merge pull request coollabsio#2677 from coollabsio/next
v4.0.0-beta.305
2 parents 3a1e5f7 + a849c25 commit cc36a0e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+228
-199
lines changed

app/Actions/CoolifyTask/PrepareCoolifyTask.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace App\Actions\CoolifyTask;
44

55
use App\Data\CoolifyTaskArgs;
6+
use App\Enums\ActivityTypes;
67
use App\Jobs\CoolifyTask;
78
use Spatie\Activitylog\Models\Activity;
89

@@ -40,8 +41,18 @@ public function __construct(CoolifyTaskArgs $remoteProcessArgs)
4041

4142
public function __invoke(): Activity
4243
{
43-
$job = new CoolifyTask($this->activity, ignore_errors: $this->remoteProcessArgs->ignore_errors, call_event_on_finish: $this->remoteProcessArgs->call_event_on_finish, call_event_data: $this->remoteProcessArgs->call_event_data);
44-
dispatch($job);
44+
$job = new CoolifyTask(
45+
activity: $this->activity,
46+
ignore_errors: $this->remoteProcessArgs->ignore_errors,
47+
call_event_on_finish: $this->remoteProcessArgs->call_event_on_finish,
48+
call_event_data: $this->remoteProcessArgs->call_event_data,
49+
);
50+
if ($this->remoteProcessArgs->type === ActivityTypes::COMMAND->value) {
51+
ray('Dispatching a high priority job');
52+
dispatch($job)->onQueue('high');
53+
} else {
54+
dispatch($job);
55+
}
4556
$this->activity->refresh();
4657

4758
return $this->activity;

app/Actions/CoolifyTask/RunRemoteProcess.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class RunRemoteProcess
3939
public function __construct(Activity $activity, bool $hide_from_output = false, bool $ignore_errors = false, $call_event_on_finish = null, $call_event_data = null)
4040
{
4141

42-
if ($activity->getExtraProperty('type') !== ActivityTypes::INLINE->value) {
42+
if ($activity->getExtraProperty('type') !== ActivityTypes::INLINE->value && $activity->getExtraProperty('type') !== ActivityTypes::COMMAND->value) {
4343
throw new \RuntimeException('Incompatible Activity to run a remote command.');
4444
}
4545

app/Actions/Database/StartClickhouse.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace App\Actions\Database;
44

55
use App\Models\StandaloneClickhouse;
6-
use Illuminate\Support\Str;
76
use Lorisleiva\Actions\Concerns\AsAction;
87
use Symfony\Component\Yaml\Yaml;
98

@@ -155,11 +154,11 @@ private function generate_environment_variables()
155154
$environment_variables->push("$env->key=$env->real_value");
156155
}
157156

158-
if ($environment_variables->filter(fn ($env) => Str::of($env)->contains('CLICKHOUSE_ADMIN_USER'))->isEmpty()) {
157+
if ($environment_variables->filter(fn ($env) => str($env)->contains('CLICKHOUSE_ADMIN_USER'))->isEmpty()) {
159158
$environment_variables->push("CLICKHOUSE_ADMIN_USER={$this->database->clickhouse_admin_user}");
160159
}
161160

162-
if ($environment_variables->filter(fn ($env) => Str::of($env)->contains('CLICKHOUSE_ADMIN_PASSWORD'))->isEmpty()) {
161+
if ($environment_variables->filter(fn ($env) => str($env)->contains('CLICKHOUSE_ADMIN_PASSWORD'))->isEmpty()) {
163162
$environment_variables->push("CLICKHOUSE_ADMIN_PASSWORD={$this->database->clickhouse_admin_password}");
164163
}
165164

app/Actions/Database/StartDragonfly.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace App\Actions\Database;
44

55
use App\Models\StandaloneDragonfly;
6-
use Illuminate\Support\Str;
76
use Lorisleiva\Actions\Concerns\AsAction;
87
use Symfony\Component\Yaml\Yaml;
98

@@ -155,7 +154,7 @@ private function generate_environment_variables()
155154
$environment_variables->push("$env->key=$env->real_value");
156155
}
157156

158-
if ($environment_variables->filter(fn ($env) => Str::of($env)->contains('REDIS_PASSWORD'))->isEmpty()) {
157+
if ($environment_variables->filter(fn ($env) => str($env)->contains('REDIS_PASSWORD'))->isEmpty()) {
159158
$environment_variables->push("REDIS_PASSWORD={$this->database->dragonfly_password}");
160159
}
161160

app/Actions/Database/StartKeydb.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
use App\Models\StandaloneKeydb;
66
use Illuminate\Support\Facades\Storage;
7-
use Illuminate\Support\Str;
87
use Lorisleiva\Actions\Concerns\AsAction;
98
use Symfony\Component\Yaml\Yaml;
109

@@ -163,7 +162,7 @@ private function generate_environment_variables()
163162
$environment_variables->push("$env->key=$env->real_value");
164163
}
165164

166-
if ($environment_variables->filter(fn ($env) => Str::of($env)->contains('REDIS_PASSWORD'))->isEmpty()) {
165+
if ($environment_variables->filter(fn ($env) => str($env)->contains('REDIS_PASSWORD'))->isEmpty()) {
167166
$environment_variables->push("REDIS_PASSWORD={$this->database->keydb_password}");
168167
}
169168

app/Actions/Database/StartMariadb.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace App\Actions\Database;
44

55
use App\Models\StandaloneMariadb;
6-
use Illuminate\Support\Str;
76
use Lorisleiva\Actions\Concerns\AsAction;
87
use Symfony\Component\Yaml\Yaml;
98

@@ -157,18 +156,18 @@ private function generate_environment_variables()
157156
$environment_variables->push("$env->key=$env->real_value");
158157
}
159158

160-
if ($environment_variables->filter(fn ($env) => Str::of($env)->contains('MARIADB_ROOT_PASSWORD'))->isEmpty()) {
159+
if ($environment_variables->filter(fn ($env) => str($env)->contains('MARIADB_ROOT_PASSWORD'))->isEmpty()) {
161160
$environment_variables->push("MARIADB_ROOT_PASSWORD={$this->database->mariadb_root_password}");
162161
}
163162

164-
if ($environment_variables->filter(fn ($env) => Str::of($env)->contains('MARIADB_DATABASE'))->isEmpty()) {
163+
if ($environment_variables->filter(fn ($env) => str($env)->contains('MARIADB_DATABASE'))->isEmpty()) {
165164
$environment_variables->push("MARIADB_DATABASE={$this->database->mariadb_database}");
166165
}
167166

168-
if ($environment_variables->filter(fn ($env) => Str::of($env)->contains('MARIADB_USER'))->isEmpty()) {
167+
if ($environment_variables->filter(fn ($env) => str($env)->contains('MARIADB_USER'))->isEmpty()) {
169168
$environment_variables->push("MARIADB_USER={$this->database->mariadb_user}");
170169
}
171-
if ($environment_variables->filter(fn ($env) => Str::of($env)->contains('MARIADB_PASSWORD'))->isEmpty()) {
170+
if ($environment_variables->filter(fn ($env) => str($env)->contains('MARIADB_PASSWORD'))->isEmpty()) {
172171
$environment_variables->push("MARIADB_PASSWORD={$this->database->mariadb_password}");
173172
}
174173

app/Actions/Database/StartMongodb.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace App\Actions\Database;
44

55
use App\Models\StandaloneMongodb;
6-
use Illuminate\Support\Str;
76
use Lorisleiva\Actions\Concerns\AsAction;
87
use Symfony\Component\Yaml\Yaml;
98

@@ -174,15 +173,15 @@ private function generate_environment_variables()
174173
$environment_variables->push("$env->key=$env->real_value");
175174
}
176175

177-
if ($environment_variables->filter(fn ($env) => Str::of($env)->contains('MONGO_INITDB_ROOT_USERNAME'))->isEmpty()) {
176+
if ($environment_variables->filter(fn ($env) => str($env)->contains('MONGO_INITDB_ROOT_USERNAME'))->isEmpty()) {
178177
$environment_variables->push("MONGO_INITDB_ROOT_USERNAME={$this->database->mongo_initdb_root_username}");
179178
}
180179

181-
if ($environment_variables->filter(fn ($env) => Str::of($env)->contains('MONGO_INITDB_ROOT_PASSWORD'))->isEmpty()) {
180+
if ($environment_variables->filter(fn ($env) => str($env)->contains('MONGO_INITDB_ROOT_PASSWORD'))->isEmpty()) {
182181
$environment_variables->push("MONGO_INITDB_ROOT_PASSWORD={$this->database->mongo_initdb_root_password}");
183182
}
184183

185-
if ($environment_variables->filter(fn ($env) => Str::of($env)->contains('MONGO_INITDB_DATABASE'))->isEmpty()) {
184+
if ($environment_variables->filter(fn ($env) => str($env)->contains('MONGO_INITDB_DATABASE'))->isEmpty()) {
186185
$environment_variables->push("MONGO_INITDB_DATABASE={$this->database->mongo_initdb_database}");
187186
}
188187

app/Actions/Database/StartMysql.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace App\Actions\Database;
44

55
use App\Models\StandaloneMysql;
6-
use Illuminate\Support\Str;
76
use Lorisleiva\Actions\Concerns\AsAction;
87
use Symfony\Component\Yaml\Yaml;
98

@@ -157,18 +156,18 @@ private function generate_environment_variables()
157156
$environment_variables->push("$env->key=$env->real_value");
158157
}
159158

160-
if ($environment_variables->filter(fn ($env) => Str::of($env)->contains('MYSQL_ROOT_PASSWORD'))->isEmpty()) {
159+
if ($environment_variables->filter(fn ($env) => str($env)->contains('MYSQL_ROOT_PASSWORD'))->isEmpty()) {
161160
$environment_variables->push("MYSQL_ROOT_PASSWORD={$this->database->mysql_root_password}");
162161
}
163162

164-
if ($environment_variables->filter(fn ($env) => Str::of($env)->contains('MYSQL_DATABASE'))->isEmpty()) {
163+
if ($environment_variables->filter(fn ($env) => str($env)->contains('MYSQL_DATABASE'))->isEmpty()) {
165164
$environment_variables->push("MYSQL_DATABASE={$this->database->mysql_database}");
166165
}
167166

168-
if ($environment_variables->filter(fn ($env) => Str::of($env)->contains('MYSQL_USER'))->isEmpty()) {
167+
if ($environment_variables->filter(fn ($env) => str($env)->contains('MYSQL_USER'))->isEmpty()) {
169168
$environment_variables->push("MYSQL_USER={$this->database->mysql_user}");
170169
}
171-
if ($environment_variables->filter(fn ($env) => Str::of($env)->contains('MYSQL_PASSWORD'))->isEmpty()) {
170+
if ($environment_variables->filter(fn ($env) => str($env)->contains('MYSQL_PASSWORD'))->isEmpty()) {
172171
$environment_variables->push("MYSQL_PASSWORD={$this->database->mysql_password}");
173172
}
174173

app/Actions/Database/StartPostgresql.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace App\Actions\Database;
44

55
use App\Models\StandalonePostgresql;
6-
use Illuminate\Support\Str;
76
use Lorisleiva\Actions\Concerns\AsAction;
87
use Symfony\Component\Yaml\Yaml;
98

@@ -179,18 +178,18 @@ private function generate_environment_variables()
179178
$environment_variables->push("$env->key=$env->real_value");
180179
}
181180

182-
if ($environment_variables->filter(fn ($env) => Str::of($env)->contains('POSTGRES_USER'))->isEmpty()) {
181+
if ($environment_variables->filter(fn ($env) => str($env)->contains('POSTGRES_USER'))->isEmpty()) {
183182
$environment_variables->push("POSTGRES_USER={$this->database->postgres_user}");
184183
}
185-
if ($environment_variables->filter(fn ($env) => Str::of($env)->contains('PGUSER'))->isEmpty()) {
184+
if ($environment_variables->filter(fn ($env) => str($env)->contains('PGUSER'))->isEmpty()) {
186185
$environment_variables->push("PGUSER={$this->database->postgres_user}");
187186
}
188187

189-
if ($environment_variables->filter(fn ($env) => Str::of($env)->contains('POSTGRES_PASSWORD'))->isEmpty()) {
188+
if ($environment_variables->filter(fn ($env) => str($env)->contains('POSTGRES_PASSWORD'))->isEmpty()) {
190189
$environment_variables->push("POSTGRES_PASSWORD={$this->database->postgres_password}");
191190
}
192191

193-
if ($environment_variables->filter(fn ($env) => Str::of($env)->contains('POSTGRES_DB'))->isEmpty()) {
192+
if ($environment_variables->filter(fn ($env) => str($env)->contains('POSTGRES_DB'))->isEmpty()) {
194193
$environment_variables->push("POSTGRES_DB={$this->database->postgres_db}");
195194
}
196195

app/Actions/Database/StartRedis.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
use App\Models\StandaloneRedis;
66
use Illuminate\Support\Facades\Storage;
7-
use Illuminate\Support\Str;
87
use Lorisleiva\Actions\Concerns\AsAction;
98
use Symfony\Component\Yaml\Yaml;
109

@@ -167,7 +166,7 @@ private function generate_environment_variables()
167166
$environment_variables->push("$env->key=$env->real_value");
168167
}
169168

170-
if ($environment_variables->filter(fn ($env) => Str::of($env)->contains('REDIS_PASSWORD'))->isEmpty()) {
169+
if ($environment_variables->filter(fn ($env) => str($env)->contains('REDIS_PASSWORD'))->isEmpty()) {
171170
$environment_variables->push("REDIS_PASSWORD={$this->database->redis_password}");
172171
}
173172

0 commit comments

Comments
 (0)