larave版本是5.8。我准备用redis的队列功能。根据文档,当我启动 queue: work 命令时,它无法成功执行。错误日志有异常错误环境:laravel5.8php7.2.21redis5.0.5配置/queue.php'redis' => [ 'driver' => 'redis', 'connection' => 'default', 'queue' => env('REDIS_QUEUE', 'sso'), 'retry_after' => 90, 'block_for' => null, ],应用程序/工作/LoginLog.php<?phpnamespace App\Jobs;use Illuminate\Bus\Queueable;use Illuminate\Queue\SerializesModels;use Illuminate\Queue\InteractsWithQueue;use Illuminate\Contracts\Queue\ShouldQueue;use Illuminate\Foundation\Bus\Dispatchable;use Illuminate\Support\Facades\Log;class LoginLog implements ShouldQueue{ use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; protected $data; /** * Create a new job instance. * * @return void */ public function __construct($appId) { $this->data = $appId; } /** * Execute the job. * * @return void */ public function handle() { Log::info('job handle...',$this->data); }}路线/web.phpRoute::get('test', function (){ $appid = '1854956778'; $a = \App\Jobs\LoginLog::dispatch($appid); dd($a);});邮递员测试
- 1 回答
- 0 关注
- 290 浏览
添加回答
举报
0/150
提交
取消