0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Laravel `php artisan queue:retry`でtimeoutの変更が反映されない

Posted at

バージョン
Laravel Framework 10.45.1

Laravelの queue:retry はソースコードの変更は反映される1けどtimeoutの設定が反映されなかったって話

事象

実装したJobがタイムアウトしてfailed_jobsに入っていた

namespace App\Jobs;
class MyCustomJob implements ShouldQueue
{
    use Dispatchable;
    use InteractsWithQueue;
    use Queueable;
    use SerializesModels;

    public int $timeout = 100;
...

Jobのタイムアウト設定を変更して

    public int $timeout = 600;

リトライしたけど、やはりタイムアウトしてしまう

php artisan queue:retry {uuid}

原因

failed_jobs.payload

{
  "uuid": "c2805ac5-75ef-4e15-b2ba-a92ba4365785",
  "displayName": "App\\Jobs\\MyCustomJob",
  "job": "Illuminate\\Queue\\CallQueuedHandler@call",
  "maxTries": null,
  "maxExceptions": null,
  "failOnTimeout": false,
  "backoff": null,
  "timeout": 100,
  "retryUntil": null,
  "data": {
  }
  ...

!!!

  "timeout": 100,

解決

failed_jobs.payloadのjson内のtimeout値を書き換えてからretryする

以上

  1. キューワーカーのリスタートはする必要がある

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?