试图让队列在我的共享主机上工作,
php artisan队列:在我的共享主机上工作(通过cron)返回
[ErrorException]
Invalid argument supplied for foreach()
Run Code Online (Sandbox Code Playgroud)
在我的日志文件中写入以下内容.
[2015-04-12 18:59:01] production.ERROR: exception 'ErrorException' with message 'Invalid argument supplied for foreach()' in /home/a109/vendor/symfony/console/Symfony/Component/Console/Input/ArgvInput.php:287 Stack trace:
#0 /home/a109/vendor/symfony/console/Symfony/Component/Console/Input/ArgvInput.php(287): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'Invalid argumen...', '/home/a109/vend...', 287, Array)
#1 /home/a109/vendor/symfony/console/Symfony/Component/Console/Application.php(823): Symfony\Component\Console\Input\ArgvInput->hasParameterOption(Array)
#2 /home/a109/vendor/symfony/console/Symfony/Component/Console/Application.php(123): Symfony\Component\Console\Application->configureIO(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#3 /home/a109/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(94): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#4 /home/a109/artisan(35): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#5 {main}
Run Code Online (Sandbox Code Playgroud)
在vendor/symfony/console/Symfony/Component/Console/Input/ArgvInput.php的第287行有这个函数
/**
* Returns true if the raw parameters (not parsed) contain a value.
*
* This method …Run Code Online (Sandbox Code Playgroud) in the following snippet
private async void FinishCommandExecute()
{
Console.WriteLine("FinishCommandExecute_1");
_granularBlobAnalyzer.SaveResult(SampleID, Operator, Comments);
Console.WriteLine("FinishCommandExecute_2");
await Task.Run(() => FlushCommandExecute());
Console.WriteLine("FinishCommandExecute_3");
State = GBAState.IDLE;
Console.WriteLine("FinishCommandExecute_4");
}
private async void FlushCommandExecute()
{
Console.WriteLine("FlushCommandExecute_1");
State = GBAState.FLUSHING;
Console.WriteLine("FlushCommandExecute_2");
await Task.Run(() => _granularBlobAnalyzer.Flush()); // Task to wrap sync method
Console.WriteLine("FlushCommandExecute_3");
State = GBAState.STOPPED;
Console.WriteLine("FlushCommandExecute_4");
}
Run Code Online (Sandbox Code Playgroud)
I call FinishCommandExecute (it is bound to a button as command), and I would expect the finish command would call the flush command and wait for it to finish, but …