小编bui*_*ete的帖子

使用laravel队列无法在我的共享主机解决方案上运行

试图让队列在我的共享主机上工作,

  • 我已经建立了一个cron工作来每分钟运行'php artisan queue:work'.
  • 我正在使用数据库驱动程序
  • 这些工作很好地进入了工作表
  • 如果我使用同步驱动程序,它可以在我的共享主机上运行在我的开发人员计算机上,它同时适用于同步和数据库驱动程序.
  • 我没有失败Laravel Queue:如何在共享主机上使用提供了足够的答案,因为我有cron的可能性,因此我想让它使用数据库驱动程序
  • php是来自cli和web界面的5.5版本.

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)

php queue symfony laravel

5
推荐指数
1
解决办法
1243
查看次数

async execution is different from expected

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 …

c# asynchronous async-await

1
推荐指数
1
解决办法
53
查看次数

标签 统计

async-await ×1

asynchronous ×1

c# ×1

laravel ×1

php ×1

queue ×1

symfony ×1