12 lines
1.3 KiB
PHP
12 lines
1.3 KiB
PHP
<?php
|
|
$app=(static fn($p)=>require $p)(__DIR__.'/portal-workflow-upgrade-runtime.php');
|
|
$dir=dirname(__DIR__).'/storage/app/private/investmoz-v2/portal-audit';
|
|
throw_unless(config('queue.default')==='database'&&config('queue.connections.database.queue')==='workflow-upgrade-qa',RuntimeException::class,'Dedicated clone queue required');
|
|
if(in_array('--fault',$argv,true)){
|
|
$job=app('queue')->connection()->pop('workflow-upgrade-qa');
|
|
throw_unless($job&&$job->resolveName()===App\Jobs\ScanDocumentForMalware::class,RuntimeException::class,'Only own synthetic scan job may be reserved for fault injection');
|
|
file_put_contents($dir.'/workflow-upgrade-worker-fault-20261011.json',json_encode(['at'=>gmdate('c'),'result'=>'controlled_worker_exit_after_reservation','exit_code'=>70,'target'=>config('database.connections.pgsql.database').':55441','job_id'=>$job->getJobId(),'attempts'=>$job->attempts(),'reserved_job_not_deleted'=>true,'retry_after_seconds'=>config('queue.connections.database.retry_after'),'active_writes'=>0],JSON_PRETTY_PRINT|JSON_THROW_ON_ERROR));
|
|
exit(70);
|
|
}
|
|
exit($app->handleCommand(new Symfony\Component\Console\Input\ArrayInput(['command'=>'queue:work','--queue'=>'workflow-upgrade-qa','--stop-when-empty'=>!in_array('--continuous',$argv,true),'--max-time'=>600,'--sleep'=>1,'--timeout'=>150,'--tries'=>3,'--no-interaction'=>true])));
|