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?

More than 1 year has passed since last update.

laravel タスクスケジューラー 単一サーバ上でのタスク実行指定

Posted at

この記事はmiriwoお一人様 Advent Calendar 2022の23日目の記事です

概要

  • タスクスケジューラーにて1つのサーバでのみcommandを実行してほしい時の設定方法をまとめる。

方法

  • $schedule->command()のメソッドチェーンにonOneServer()を付与する。

    $schedule->command('hogehoge')
        ->onOneServer();
    
  • コマンド(バッチ)実行サーバが複数あり、すべてのサーバで実行する必要のない処理(集計処理など)は本メソッドを指定することで複数サーバでの実行を防げる。

参考文献

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?