Looking to hire Laravel developers? Try LaraJobs

laravel_mutex maintained by alanalbert

Description
Get the mutex file path of command in laravel.
Author
Last update
2020/11/12 05:32 (dev-master)
License
Links
Downloads
6

Comments
comments powered by Disqus

Get the file mutex path of command in laravel or lumen.

获取laravel或lumen的命令文件锁路径。

Usage

  1. Install
    composer require alanalbert/laravel_mutex --dev
    
  2. Code
     $path = get_command_mutex(function (\Illuminate\Console\Scheduling\Schedule $schedule) {
         // schedule command
         return $schedule->command('test')->withoutOverlapping()->runInBackground();
     });
    
    You can find the file in storage/framework/cache/data.

Different environments will get different paths. 不同的运行环境将会得到不同的文件锁路径。