{"id":4396,"date":"2022-02-06T11:09:45","date_gmt":"2022-02-06T02:09:45","guid":{"rendered":"https:\/\/www.wetch.co.jp\/?p=4396"},"modified":"2022-02-24T14:31:34","modified_gmt":"2022-02-24T05:31:34","slug":"laravel%ef%bc%9a%e3%82%bf%e3%82%a4%e3%83%9e%e3%83%bc%e5%87%a6%e7%90%86%e3%81%ae%e9%9d%9e%e5%90%8c%e6%9c%9f%e5%ae%9f%e8%a1%8c","status":"publish","type":"post","link":"https:\/\/www.wetch.co.jp\/note\/laravel%ef%bc%9a%e3%82%bf%e3%82%a4%e3%83%9e%e3%83%bc%e5%87%a6%e7%90%86%e3%81%ae%e9%9d%9e%e5%90%8c%e6%9c%9f%e5%ae%9f%e8%a1%8c\/","title":{"rendered":"Laravel\uff1a\u30bf\u30a4\u30de\u30fc\u51e6\u7406\u306e\u975e\u540c\u671f\u5b9f\u884c"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Laravel\u306e\u30bf\u30a4\u30de\u30fc\u51e6\u7406\u306b\u95a2\u3057\u3066\u306f\u7121\u6761\u4ef6\u306b\u975e\u540c\u671f\u306b\u5b9f\u884c\u3055\u308c\u308b\u3082\u306e\u3068\u601d\u3063\u3066\u3044\u307e\u3057\u305f\u304c\u3001\u5b9f\u306f\u5c11\u3005\u8907\u96d1\u306a\u72b6\u6cc1\u3067\u3042\u308b\u3053\u3068\u304c\u5206\u304b\u308a\u307e\u3057\u305f\u306e\u3067\u3001\u6539\u3081\u3066\u6574\u7406\u3057\u3066\u304a\u304d\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Laravel\u306e\u30bf\u30a4\u30de\u30fc\u51e6\u7406<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Laravel\u3067\u30bf\u30a4\u30de\u30fc\u51e6\u7406\uff08\u30bf\u30b9\u30af\u30b9\u30b1\u30b8\u30e5\u30fc\u30eb\uff09\u3092\u884c\u3044\u305f\u3044\u5834\u5408\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u307e\u305a\u3001\u300capp\/Console\/Commands\u300d\u306b\u671f\u5f85\u3059\u308b\u51e6\u7406\u5185\u5bb9\u3092\u542b\u3080\u30b3\u30de\u30f3\u30c9\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php\n\nnamespace App\\Console\\Commands;\n\nuse Illuminate\\Console\\Command;\n\nclass TimerTest1 extends Command\n{\n    protected $signature = 'command:\uff1c\u30b3\u30de\u30f3\u30c9\u540d\uff1e';\n\n    protected $description = '\uff1c\u30b3\u30de\u30f3\u30c9\u306e\u6982\u8981\u8aac\u660e\uff1e';\n\n    public function __construct()\n    {\n        parent::__construct();\n    }\n\n    public function handle()\n    {\n        \/\/ \u671f\u5f85\u3059\u308b\u51e6\u7406\u5185\u5bb9\n    }\n}\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e0a\u8a18\u3092\u300capp\/Console\/Kernel.php\u300d\u304b\u3089\u5b9f\u884c\u3059\u308b\u3088\u3046\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php\n\nnamespace App\\Console;\n\nuse Illuminate\\Console\\Scheduling\\Schedule;\nuse Illuminate\\Foundation\\Console\\Kernel as ConsoleKernel;\n\nclass Kernel extends ConsoleKernel\n{\n    protected $commands = &#91;\n        \/\/\n    ];\n\n    protected function schedule(Schedule $schedule)\n    {\n        $schedule-&gt;command('command:timer_test_1');\n    }\n\n    protected function commands()\n    {\n        $this-&gt;load(__DIR__.'\/Commands');\n\n        require base_path('routes\/console.php');\n    }\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u6700\u5f8c\u306b\u4e0a\u8a18\u8a2d\u5b9a\u5185\u5bb9\u304c\u5b9a\u671f\u7684\u306b\u547c\u3073\u51fa\u3055\u308c\u308b\u3088\u3046cron\u306b\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>* * * * * cd \uff1cLaravel\u74b0\u5883\u3078\u306e\u30d1\u30b9\uff1e &amp;&amp; php artisan schedule:run &gt;&gt; \/dev\/null 2&gt;&amp;1<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u3064\u307e\u308a\u306f\u3001\u6bce\u5206<meta charset=\"utf-8\">\u300c<meta charset=\"utf-8\">App\\Console<meta charset=\"utf-8\">\\<meta charset=\"utf-8\">Kernel\u300d\u30af\u30e9\u30b9\u3092\u547c\u3073\u51fa\u3057\u3064\u3064\u3001\u540c\u30af\u30e9\u30b9\u5185\u306e\u300c<meta charset=\"utf-8\">schedule\u300d\u30e1\u30bd\u30c3\u30c9\u3067\u5b9f\u884c\u3059\u3079\u304d\u30b3\u30de\u30f3\u30c9\u3092\u9078\u629e\u7684\u306b\u5b9f\u884c\u3059\u308b\u8a33\u3067\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u300c\u9078\u629e\u7684\u300d\u306b\u3068\u66f8\u304d\u307e\u3057\u305f\u304c\u3001<meta charset=\"utf-8\">\u300c<meta charset=\"utf-8\">schedule\u300d\u30e1\u30bd\u30c3\u30c9\u3067\u306f\u5b9f\u884c\u30bf\u30a4\u30df\u30f3\u30b0\u306e\u6307\u5b9a\u304c\u3067\u304d\u307e\u3059\u3002<br>\u4f8b\u3048\u30701\u6642\u9593\u306b\u4e00\u56de\u5b9f\u884c\u3057\u305f\u3044\u5834\u5408\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u66f8\u304f\u3053\u3068\u3067\u3001<meta charset=\"utf-8\">\u300c<meta charset=\"utf-8\">schedule\u300d\u30e1\u30bd\u30c3\u30c9\u81ea\u4f53\u306f\u6bce\u5206\u547c\u3073\u51fa\u3055\u308c\u306a\u304c\u3089\u3001\u300ctimer_test_1\u300d\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u306e\u306f1\u6642\u9593\u306b\u4e00\u56de\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><meta charset=\"utf-8\">$schedule-&gt;command('command:timer_test_1')-&gt;hourly();;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u5b9f\u884c\u30bf\u30a4\u30df\u30f3\u30b0\u3068\u3057\u3066\u306f\u69d8\u3005\u306a\u6307\u5b9a\u304c\u53ef\u80fd\u3067\u3059\u304c\u3001\u3053\u306e\u8fba\u306f\u672c\u8a18\u4e8b\u306e\u8da3\u65e8\u304b\u3089\u306f\u5916\u308c\u307e\u3059\u306e\u3067\u3001\u8a73\u3057\u304f\u306fGoogle\u5148\u751f\u306b\u805e\u3044\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">\u975e\u540c\u671f\u6027\u306e\u78ba\u8a8d<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e0a\u8a18\u306e\u3088\u3046\u306b<meta charset=\"utf-8\"><meta charset=\"utf-8\">\u300c<meta charset=\"utf-8\">App\\Console<meta charset=\"utf-8\">\\<meta charset=\"utf-8\">Kernel\u300d\u30af\u30e9\u30b9\u306e<meta charset=\"utf-8\">\u300c<meta charset=\"utf-8\">schedule\u300d\u30e1\u30bd\u30c3\u30c9\u304b\u3089\u671f\u5f85\u3059\u308b\u51e6\u7406\u5185\u5bb9\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u3057\u3066\u3001\u305d\u306e\u5b9f\u884c\u306f\u540c\u671f\u7684\u306b\u884c\u308f\u308c\u308b\u304b\u3001\u975e\u540c\u671f\u7684\u306b\u884c\u308f\u308c\u308b\u304b\u3092\u78ba\u8a8d\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><meta charset=\"utf-8\">\u300c<meta charset=\"utf-8\">schedule\u300d\u30e1\u30bd\u30c3\u30c9\u306e\u5185\u5bb9\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>        self::log('schedule start', null);\n        $schedule-&gt;command('command:timer_test_1');\n        self::log('schedule end', null);<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u300cself::log\u300d\u306f\u72ec\u81ea\u306b\u7528\u610f\u3057\u305f\u30ed\u30b0\u30e1\u30bd\u30c3\u30c9\u3067\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u540c\u69d8\u306b\u300c<meta charset=\"utf-8\">App\\Console\\Commands<meta charset=\"utf-8\">\\<meta charset=\"utf-8\">TimerTest1\u300d\u30af\u30e9\u30b9\u306e\u300c<meta charset=\"utf-8\">handle\u300d\u30e1\u30bd\u30c3\u30c9\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>        $startTime = date('Y-m-d H:i:s');\n        self::log('command 1 start', $startTime);\n        sleep(10);\n        self::log('command 1 end', $startTime);<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u51e6\u7406\u5b8c\u4e86\u307e\u3067\u306b10\u79d2\u304b\u304b\u308b\u3088\u3046\u306b\u3057\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5b9f\u884c\u7d50\u679c\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>2022\/02\/06 09:27:01.282092 DEBUG: &#91;x] schedule start\n2022\/02\/06 09:27:01.283893 DEBUG: &#91;x] schedule end\n2022\/02\/06 09:27:01.541192 DEBUG: &#91;x] command 1 start 2022-02-06 09:27:01\n2022\/02\/06 09:27:11.542021 DEBUG: &#91;x] command 1 end 2022-02-06 09:27:01<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><meta charset=\"utf-8\">\u300c<meta charset=\"utf-8\">App\\Console<meta charset=\"utf-8\">\\<meta charset=\"utf-8\">Kernel\u300d\u30af\u30e9\u30b9\u306e<meta charset=\"utf-8\">\u300c<meta charset=\"utf-8\">schedule\u300d\u30e1\u30bd\u30c3\u30c9\u306f<meta charset=\"utf-8\">\u300c<meta charset=\"utf-8\">App\\Console\\Commands<meta charset=\"utf-8\">\\<meta charset=\"utf-8\">TimerTest1\u300d\u30af\u30e9\u30b9\u306e\u5b9f\u884c\u3092\u5f85\u3061\u5408\u308f\u305b\u305a\u306b\u5b8c\u4e86\u3057\u3066\u3044\u307e\u3059\u3002\u3064\u307e\u308a\u30b3\u30de\u30f3\u30c9\u306f\u975e\u540c\u671f\u306b\u5b9f\u884c\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u306e\u8fba\u306f\u4e88\u5b9a\u901a\u308a\u3067\u3057\u305f\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u3067\u306f\u3001\u5b9f\u884c\u5bfe\u8c61\u304c\u8907\u6570\u5b58\u5728\u3057\u305f\u5834\u5408\u306f\u3069\u3046\u3067\u3057\u3087\u3046\uff1f<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u65b0\u305f\u306b<meta charset=\"utf-8\">\u300c<meta charset=\"utf-8\">App\\Console\\Commands<meta charset=\"utf-8\">\\<meta charset=\"utf-8\">TimerTest2\u300d\u30af\u30e9\u30b9\u3092\u7528\u610f\u3057\u3001\u300c<meta charset=\"utf-8\">handle\u300d\u30e1\u30bd\u30c3\u30c9\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>        $startTime = date('Y-m-d H:i:s');\n        self::log('command 2 start', $startTime);\n        self::log('command 2 end', $startTime);<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><meta charset=\"utf-8\">\u300cApp\\Console<meta charset=\"utf-8\">\\<meta charset=\"utf-8\">Kernel\u300d\u30af\u30e9\u30b9\u306e<meta charset=\"utf-8\">\u300c<meta charset=\"utf-8\">schedule\u300d\u30e1\u30bd\u30c3\u30c9\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>        self::log('schedule start', null);\n        $schedule-&gt;command('command:timer_test_1');\n        $schedule-&gt;command('command:timer_test_2');\n        self::log('schedule end', null);<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e0a\u8a18\u5b9f\u884c\u7d50\u679c\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>2022\/02\/06 09:56:02.249527 DEBUG: &#91;x] schedule start\n2022\/02\/06 09:56:02.251527 DEBUG: &#91;x] schedule end\n2022\/02\/06 09:56:02.498800 DEBUG: &#91;x] command 1 start 2022-02-06 09:56:02\n2022\/02\/06 09:56:12.499966 DEBUG: &#91;x] command 1 end 2022-02-06 09:56:02\n2022\/02\/06 09:56:12.748293 DEBUG: &#91;x] command 2 start 2022-02-06 09:56:12\n2022\/02\/06 09:56:12.748619 DEBUG: &#91;x] command 2 end 2022-02-06 09:56:12<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><meta charset=\"utf-8\">\u300cApp\\Console<meta charset=\"utf-8\">\\<meta charset=\"utf-8\">Kernel\u300d\u30af\u30e9\u30b9\u3068\u5404\u30b3\u30de\u30f3\u30c9\u306e\u5b9f\u884c\u306f\u975e\u540c\u671f\u306b\u884c\u308f\u308c\u307e\u3059\u304c\u3001\u30b3\u30de\u30f3\u30c9\u76f8\u4e92\u3067\u306f\u5148\u306b\u5b9f\u884c\u3057\u3066\u3044\u308b\u30b3\u30de\u30f3\u30c9\u306e\u5b8c\u4e86\u3092\u5f85\u3061\u5408\u308f\u305b\u3066\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u304c\u5b9f\u884c\u3055\u308c\u308b\u3088\u3046\u3001\u540c\u671f\u7684\u306b\u5236\u5fa1\u3055\u308c\u3066\u3044\u308b\u3088\u3046\u3067\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u306e\u70b9\u306f\u4e88\u60f3\u5916\u3067\u3057\u305f\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u500b\u4eba\u7684\u306b\u306f\u30bf\u30a4\u30de\u30fc\u5b9f\u884c\u3055\u305b\u305f\u3044\u51e6\u7406\u5185\u5bb9\u304c\u8907\u6570\u5b58\u5728\u3059\u308b\u5834\u5408\u3067\u3082\u307b\u3068\u3093\u3069\u304c\u76f8\u4e92\u306b\u4f9d\u5b58\u95a2\u4fc2\u304c\u306a\u3044\u3082\u306e\u3067\u3059\u3057\u3001\u3082\u3057\u4f9d\u5b58\u95a2\u4fc2\u304c\u3042\u308b\u51e6\u7406\u5185\u5bb9\u3067\u3042\u308c\u30701\u3064\u306e\u30b3\u30de\u30f3\u30c9\u5185\u3067\u305d\u308c\u3089\u3092\u307e\u3068\u3081\u3066\u5b9f\u884c\u3059\u308b\u3088\u3046\u306b\u3057\u3066\u3044\u308b\u306e\u3067\u3001\u4e0a\u8a18\u306e\u3088\u3046\u306b\u8907\u6570\u30b3\u30de\u30f3\u30c9\u304c\u540c\u671f\u7684\u306b\u5b9f\u884c\u3055\u308c\u308b\u3042\u308a\u304c\u305f\u307f\u304c\u4eca\u3072\u3068\u3064\u5206\u304b\u308a\u307e\u305b\u3093\u3002<br>\u9006\u306b\u4e0a\u8a18\u306e\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u308b\u3053\u3068\u3067\u3001\u8d77\u52d5\u9806\u304c\u5f8c\u306e\u65b9\u306e\u30b3\u30de\u30f3\u30c9\u306e\u5b9f\u884c\u30bf\u30a4\u30df\u30f3\u30b0\u304c\u672c\u6765\u671f\u5f85\u3055\u308c\u305f\u6642\u523b\u3088\u308a\u3082\u9045\u308c\u3066\u3057\u307e\u3046\u306e\u3067\u3001\u30c7\u30e1\u30ea\u30c3\u30c8\u306e\u65b9\u306f\u7c21\u5358\u306b\u601d\u3044\u3064\u304f\u306e\u3067\u3059\u304c\u2026<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">\u30b3\u30de\u30f3\u30c9\u306e\u975e\u540c\u671f\u5b9f\u884c<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">\u3067\u306f\u3001<meta charset=\"utf-8\">\u300c<meta charset=\"utf-8\">schedule\u300d\u30e1\u30bd\u30c3\u30c9\u304b\u3089\u8907\u6570\u30b3\u30de\u30f3\u30c9\u3092\u76f8\u4e92\u306b\u975e\u540c\u671f\u306b\u5b9f\u884c\u3057\u305f\u3044\u5834\u5408\u306f\u3069\u3046\u3059\u308b\u304b\u3068\u8a00\u3046\u3068\u3001\u300crunInBackground\u300d\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>        self::log('schedule start', null);\n        $schedule-&gt;command('command:timer_test_1')-&gt;runInBackground();\n        $schedule-&gt;command('command:timer_test_2')-&gt;runInBackground();\n        self::log('schedule end', null);<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u5b9f\u884c\u7d50\u679c\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>2022\/02\/06 10:12:02.297901 DEBUG: &#91;x] schedule start\n2022\/02\/06 10:12:02.299729 DEBUG: &#91;x] schedule end\n2022\/02\/06 10:12:02.617093 DEBUG: &#91;x] command 1 start 2022-02-06 10:12:02\n2022\/02\/06 10:12:02.639839 DEBUG: &#91;x] command 2 start 2022-02-06 10:12:02\n2022\/02\/06 10:12:02.640129 DEBUG: &#91;x] command 2 end 2022-02-06 10:12:02\n2022\/02\/06 10:12:02.897087 DEBUG: &#91;x] schedule start\n2022\/02\/06 10:12:02.898893 DEBUG: &#91;x] schedule end\n2022\/02\/06 10:12:12.618273 DEBUG: &#91;x] command 1 end 2022-02-06 10:12:02\n2022\/02\/06 10:12:12.860450 DEBUG: &#91;x] schedule start\n2022\/02\/06 10:12:12.862174 DEBUG: &#91;x] schedule end<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u975e\u540c\u671f\u7684\u306b\u5b9f\u884c\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u3063\u305f\u7d50\u679c\u3068\u3057\u3066\u30ed\u30b0\u306f\u898b\u96e3\u304f\u306a\u308a\u307e\u3057\u305f\u304c\u3001\u300ctimer_test_1\u300d\u306e\u5b8c\u4e86\u3092\u5f85\u305f\u305a\u306b\u300ctimer_test_2\u300d\u304c\u8d77\u52d5\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u3063\u305f\u306e\u306f\u5206\u304b\u308b\u304b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u8b0e\u306a\u306e\u306f\u3001\u305d\u308c\u305e\u308c\u306e\u30b3\u30de\u30f3\u30c9\u5b8c\u4e86\u6642\u306b\u518d\u5ea6<meta charset=\"utf-8\">\u300c<meta charset=\"utf-8\">schedule\u300d\u30e1\u30bd\u30c3\u30c9\u304c\u5b9f\u884c\u3055\u308c\u305f\u8a18\u9332\u304c\u6b8b\u3063\u3066\u3044\u308b\u70b9\u3067\u3059\u3002<br>\u540c\u5b9f\u884c\u6642\u306b\u518d\u5ea6\u30b3\u30de\u30f3\u30c9\u304c\u591a\u91cd\u306b\u5b9f\u884c\u3055\u308c\u3066\u3057\u307e\u3046\u3068\u8a00\u3046\u3088\u3046\u306a\u3053\u3068\u306b\u306f\u306a\u3063\u3066\u3044\u306a\u3044\u3088\u3046\u3067\u3059\u304c\u3001\u306a\u305c\u3053\u306e\u3088\u3046\u306a\u632f\u308b\u821e\u3044\u306b\u306a\u3063\u3066\u3044\u308b\u304b\u306f\u3088\u304f\u5206\u304b\u308a\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">\u591a\u91cd\u5b9f\u884c\u306e\u6291\u6b62<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">\u524d\u8ff0\u306e\u30ed\u30b0\u306b\u304a\u3044\u3066\u3001<meta charset=\"utf-8\">\u300c<meta charset=\"utf-8\">schedule\u300d\u30e1\u30bd\u30c3\u30c9\u304c\u60f3\u5b9a\u5916\u306b\u8907\u6570\u56de\u547c\u3073\u51fa\u3055\u308c\u3066\u3044\u308b\u3089\u3057\u304d\u75d5\u8de1\u304c\u767a\u898b\u3055\u308c\u307e\u3057\u305f\u3002<br>\u3053\u3053\u3067\u306f\u8aa4\u3063\u3066\u30b3\u30de\u30f3\u30c9\u304c\u591a\u91cd\u306b\u5b9f\u884c\u3055\u308c\u3066\u3044\u306a\u3044\u3053\u3068\u306f\u78ba\u8a8d\u3067\u304d\u307e\u3057\u305f\u304c\u3001\u4f8b\u3048\u3070\u6bce\u5206\u547c\u3073\u51fa\u3057\u3066\u3044\u308b\u30b3\u30de\u30f3\u30c9\u306e\u5b9f\u884c\u6642\u9593\u304c1\u5206\u3092\u8d85\u3048\u3066\u3057\u307e\u3063\u305f\u5834\u5408\u3001\u540c\u4e00\u30b3\u30de\u30f3\u30c9\u304c\u591a\u91cd\u306b\u5b9f\u884c\u3055\u308c\u308b\u5f62\u306b\u306a\u308b\u3053\u3068\u306f\u3042\u308a\u5f97\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u30b3\u30de\u30f3\u30c9\u306e\u51e6\u7406\u5185\u5bb9\u306b\u3088\u3063\u3066\u306f\u591a\u91cd\u306b\u5b9f\u884c\u3055\u308c\u308b\u3068\u90fd\u5408\u304c\u60aa\u3044\u3082\u306e\u3082\u3042\u308a\u307e\u3059\u3002\u305d\u306e\u3088\u3046\u306a\u5834\u5408\u306f\u300cwithoutOverlapping\u300d\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u78ba\u8a8d\u306e\u305f\u3081\u3001<meta charset=\"utf-8\">\u300c<meta charset=\"utf-8\">App\\Console\\Commands<meta charset=\"utf-8\">\\<meta charset=\"utf-8\">TimerTest1\u300d\u306e<meta charset=\"utf-8\">\u300c<meta charset=\"utf-8\">handle\u300d\u30e1\u30bd\u30c3\u30c9\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>        $startTime = date('Y-m-d H:i:s');\n        self::logDebug('command 1 start', $startTime);\n        sleep(70);\n        self::logDebug('command 1 end', $startTime);<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><meta charset=\"utf-8\">\u300c<meta charset=\"utf-8\">schedule\u300d\u30e1\u30bd\u30c3\u30c9\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>        self::log('schedule start', null);\n        $schedule-&gt;command('command:timer_test_1')-&gt;runInBackground()-&gt;withoutOverlapping();\n        $schedule-&gt;command('command:timer_test_2')-&gt;runInBackground();\n        self::log('schedule end', null);<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u7d50\u679c\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>2022\/02\/06 10:34:01.749495 DEBUG: &#91;x] schedule start\n2022\/02\/06 10:34:01.751288 DEBUG: &#91;x] schedule end\n2022\/02\/06 10:34:02.010568 DEBUG: &#91;x] command 1 start 2022-02-06 10:34:01\n2022\/02\/06 10:34:02.019117 DEBUG: &#91;x] command 2 start 2022-02-06 10:34:02\n2022\/02\/06 10:34:02.019380 DEBUG: &#91;x] command 2 end 2022-02-06 10:34:02\n2022\/02\/06 10:34:02.245999 DEBUG: &#91;x] schedule start\n2022\/02\/06 10:34:02.247830 DEBUG: &#91;x] schedule end\n2022\/02\/06 10:35:02.120284 DEBUG: &#91;x] schedule start\n2022\/02\/06 10:35:02.122275 DEBUG: &#91;x] schedule end\n2022\/02\/06 10:35:02.375262 DEBUG: &#91;x] command 2 start 2022-02-06 10:35:02\n2022\/02\/06 10:35:02.375590 DEBUG: &#91;x] command 2 end 2022-02-06 10:35:02\n2022\/02\/06 10:35:02.605442 DEBUG: &#91;x] schedule start\n2022\/02\/06 10:35:02.607347 DEBUG: &#91;x] schedule end\n2022\/02\/06 10:35:12.011435 DEBUG: &#91;x] command 1 end 2022-02-06 10:34:01\n2022\/02\/06 10:35:12.256316 DEBUG: &#91;x] schedule start\n2022\/02\/06 10:35:12.258108 DEBUG: &#91;x] schedule end\n2022\/02\/06 10:36:01.438651 DEBUG: &#91;x] schedule start\n2022\/02\/06 10:36:01.440495 DEBUG: &#91;x] schedule end\n2022\/02\/06 10:36:01.720559 DEBUG: &#91;x] command 1 start 2022-02-06 10:36:01\n2022\/02\/06 10:36:01.729732 DEBUG: &#91;x] command 2 start 2022-02-06 10:36:01\n2022\/02\/06 10:36:01.730008 DEBUG: &#91;x] command 2 end 2022-02-06 10:36:01\n2022\/02\/06 10:36:01.958415 DEBUG: &#91;x] schedule start\n2022\/02\/06 10:36:01.960211 DEBUG: &#91;x] schedule end\n2022\/02\/06 10:37:01.697863 DEBUG: &#91;x] schedule start\n2022\/02\/06 10:37:01.699637 DEBUG: &#91;x] schedule end\n2022\/02\/06 10:37:01.941760 DEBUG: &#91;x] command 2 start 2022-02-06 10:37:01\n2022\/02\/06 10:37:01.942265 DEBUG: &#91;x] command 2 end 2022-02-06 10:37:01\n2022\/02\/06 10:37:02.215280 DEBUG: &#91;x] schedule start\n2022\/02\/06 10:37:02.217737 DEBUG: &#91;x] schedule end\n2022\/02\/06 10:37:11.721607 DEBUG: &#91;x] command 1 end 2022-02-06 10:36:01\n2022\/02\/06 10:37:11.976012 DEBUG: &#91;x] schedule start\n2022\/02\/06 10:37:11.977954 DEBUG: &#91;x] schedule end<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u300ctimer_test_1\u300d\u306b\u95a2\u3057\u3066\u306f\u300c10:34:02\u300d\u306b\u5b9f\u884c\u3055\u308c\u3001\u300c10:35:12\u300d\u306b\u7d42\u4e86\u3057\u3066\u3044\u307e\u3059\u3002\u305d\u306e\u9593\u300c<meta charset=\"utf-8\">10:35:02\u300d\u306b\u3082\u300cschedule\u300d\u30e1\u30bd\u30c3\u30c9\u306f\u5b9f\u884c\u3055\u308c\u3066\u3044\u307e\u3059\u304c\u3001\u3053\u3053\u3067\u306f<meta charset=\"utf-8\">\u300ctimer_test_1\u300d\u306e\u5b9f\u884c\u306f\u884c\u308f\u308c\u305a\u3001\u6b21\u306e\u300c10:36:01\u300d\u306e<meta charset=\"utf-8\">\u300cschedule\u300d\u30e1\u30bd\u30c3\u30c9\u5b9f\u884c\u6642\u306b\u306f\u518d\u5ea6<meta charset=\"utf-8\">\u300ctimer_test_1\u300d\u304c\u5b9f\u884c\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e00\u65b9\u3067\u3001<meta charset=\"utf-8\">\u300ctimer_test_2\u300d\u306e\u5b9f\u884c\u306f<meta charset=\"utf-8\">\u300ctimer_test_1\u300d\u306e\u72b6\u6cc1\u306b\u5f71\u97ff\u3055\u308c\u305a\u306b\u7c9b\u3005\u3068\u884c\u308f\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">\u7dcf\u62ec<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">\u3082\u3068\u3082\u3068<meta charset=\"utf-8\">\u300cschedule\u300d\u30e1\u30bd\u30c3\u30c9\u304b\u3089\u306e\u5404\u30b3\u30de\u30f3\u30c9\u5b9f\u884c\u306f\u5b8c\u5168\u306b\u975e\u540c\u671f\u3067\u3042\u308b\u3068\u306e\u601d\u3044\u8fbc\u307f\u3067\u30bf\u30a4\u30de\u30fc\u51e6\u7406\u3092\u884c\u3063\u3066\u3044\u305f\u306e\u3067\u3001\u5b9f\u884c\u30bf\u30a4\u30df\u30f3\u30b0\u304c\u9045\u308c\u308b\u30b1\u30fc\u30b9\u304c\u3042\u308a\u307e\u3057\u305f\u3002<br><meta charset=\"utf-8\">\u300cschedule\u300d\u30e1\u30bd\u30c3\u30c9\u3068\u30b3\u30de\u30f3\u30c9\u306e\u5b9f\u884c\u306f\u975e\u540c\u671f\u3067\u3042\u308a\u306a\u304c\u3089\u3001\u30b3\u30de\u30f3\u30c9\u76f8\u4e92\u306e\u5b9f\u884c\u306f\u540c\u671f\uff08\u9806\u6b21\uff09\u5b9f\u884c\u306b\u306a\u3063\u3066\u3044\u308b\u70b9\u306f\u5c11\u3005\u7f60\u3063\u307d\u304f\u601d\u3044\u307e\u3059\u304c\u2026<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u591a\u91cd\u5b9f\u884c\u6291\u6b62\uff08<meta charset=\"utf-8\">withoutOverlapping\uff09\u306f\u4ee5\u524d\u304b\u3089\u5fc5\u8981\u306b\u5fdc\u3058\u3066\u63a1\u7528\u3057\u3066\u3044\u305f\u306e\u3067\u3059\u304c\u3001\u3053\u3053\u306b\u975e\u540c\u671f\uff08<meta charset=\"utf-8\">runInBackground\uff09\u3092\u52a0\u3048\u305f\u6319\u52d5\u3092\u660e\u78ba\u306b\u78ba\u8a8d\u3067\u304d\u305f\u3068\u8a00\u3046\u70b9\u3067\u3001\u4eca\u56de\u306e\u4f5c\u696d\u306f\u610f\u5473\u304c\u3042\u3063\u305f\u304b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u305f\u3060\u3001\u975e\u540c\u671f\u30b3\u30de\u30f3\u30c9\u5b8c\u4e86\u6642\u306b\u9010\u4e00\u300c<meta charset=\"utf-8\">schedule\u300d\u30e1\u30bd\u30c3\u30c9\u304c\u547c\u3070\u308c\u3066\u3044\u308b\u70b9\u3060\u3051\u306f\u672a\u3060\u306b\u8b0e\u3067\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Laravel\u306e\u30bf\u30a4\u30de\u30fc\u51e6\u7406\u306b\u95a2\u3057\u3066\u306f\u7121\u6761\u4ef6\u306b\u975e\u540c\u671f\u306b\u5b9f\u884c\u3055\u308c\u308b\u3082\u306e\u3068\u601d\u3063\u3066\u3044\u307e\u3057\u305f\u304c\u3001\u5b9f\u306f\u5c11\u3005\u8907\u96d1\u306a\u72b6\u6cc1\u3067\u3042\u308b\u3053\u3068\u304c\u5206\u304b\u308a\u307e\u3057\u305f\u306e\u3067\u3001\u6539\u3081\u3066\u6574\u7406\u3057\u3066\u304a\u304d\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002 Laravel\u306e\u30bf\u30a4\u30de\u30fc\u51e6\u7406 Laravel\u3067\u30bf [&hellip;]<\/p>\n","protected":false},"author":6,"featured_media":4433,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_wp_rev_ctl_limit":""},"categories":[210],"tags":[],"class_list":["post-4396","post","type-post","status-publish","format-standard","has-post-thumbnail","category-210"],"_links":{"self":[{"href":"https:\/\/www.wetch.co.jp\/note\/wp-json\/wp\/v2\/posts\/4396","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wetch.co.jp\/note\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wetch.co.jp\/note\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wetch.co.jp\/note\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wetch.co.jp\/note\/wp-json\/wp\/v2\/comments?post=4396"}],"version-history":[{"count":0,"href":"https:\/\/www.wetch.co.jp\/note\/wp-json\/wp\/v2\/posts\/4396\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wetch.co.jp\/note\/wp-json\/wp\/v2\/media\/4433"}],"wp:attachment":[{"href":"https:\/\/www.wetch.co.jp\/note\/wp-json\/wp\/v2\/media?parent=4396"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wetch.co.jp\/note\/wp-json\/wp\/v2\/categories?post=4396"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wetch.co.jp\/note\/wp-json\/wp\/v2\/tags?post=4396"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}