Support processing nodelists from file repository and assume nodelists are zip fiels

This commit is contained in:
Deon George
2022-11-04 22:26:08 +11:00
parent 2790381a30
commit b45e2c6dd8
3 changed files with 48 additions and 34 deletions

View File

@@ -5,6 +5,7 @@ namespace App\Console\Commands;
use Illuminate\Console\Command;
use App\Jobs\NodelistImport as Job;
use App\Models\File;
class NodelistImport extends Command
{
@@ -14,7 +15,7 @@ class NodelistImport extends Command
* @var string
*/
protected $signature = 'nodelist:import'
.' {file : Nodelist File}'
.' {file : File ID}'
.' {--D|delete : Delete old data for the date}'
.' {--U|unlink : Delete file after import}';
@@ -32,6 +33,6 @@ class NodelistImport extends Command
*/
public function handle()
{
return Job::dispatchSync($this->argument('file'),$this->option('delete'),$this->option('unlink'));
return Job::dispatchSync(File::findOrFail($this->argument('file')),$this->option('delete'),$this->option('unlink'));
}
}