Skip to content

Commit 0aacb06

Browse files
committed
Horizon
1 parent 51dcfdd commit 0aacb06

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"require": {
2222
"filament/spatie-laravel-media-library-plugin": "3.x-dev",
2323
"laravel/framework": "^12.0",
24+
"laravel/horizon": "5.x-dev",
2425
"laravel/telescope": "5.x-dev",
2526
"laravel/tinker": "^2.8",
2627
"moox/audit": "*",
@@ -163,4 +164,4 @@
163164
},
164165
"minimum-stability": "dev",
165166
"prefer-stable": false
166-
}
167+
}

packages/data/src/Console/Commands/ImportStaticDataCommand.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,22 @@
77

88
class ImportStaticDataCommand extends Command
99
{
10-
protected $signature = 'moox:data:import-static';
10+
protected $signature = 'moox:data:import-static {--sync : Run the import synchronously}';
1111

1212
protected $description = 'Import static data from REST Countries API';
1313

1414
public function handle()
1515
{
16-
ImportStaticDataJob::dispatch();
16+
$this->info('Starting static data import...');
17+
18+
if ($this->option('sync')) {
19+
$this->info('Running import synchronously...');
20+
(new ImportStaticDataJob)->handle();
21+
$this->info('Import completed!');
22+
} else {
23+
$this->info('Dispatching import job to queue...');
24+
ImportStaticDataJob::dispatch();
25+
$this->info('Job dispatched! Make sure your queue worker is running.');
26+
}
1727
}
1828
}

0 commit comments

Comments
 (0)