正在显示
1 个修改的文件
包含
5 行增加
和
1 行删除
| @@ -3,6 +3,7 @@ | @@ -3,6 +3,7 @@ | ||
| 3 | //error_reporting(); | 3 | //error_reporting(); |
| 4 | include_once __DIR__."/../vendor/autoload.php"; | 4 | include_once __DIR__."/../vendor/autoload.php"; |
| 5 | 5 | ||
| 6 | +@file_put_contents('sync_run.log',"进程启动 ".getmypid(),FILE_APPEND); | ||
| 6 | 7 | ||
| 7 | swoole_set_process_name('php-email-sync-list'); | 8 | swoole_set_process_name('php-email-sync-list'); |
| 8 | //TODO:: 不知道为什么,隔断时间mysql会连不上 | 9 | //TODO:: 不知道为什么,隔断时间mysql会连不上 |
| @@ -12,7 +13,10 @@ swoole_set_process_name('php-email-sync-list'); | @@ -12,7 +13,10 @@ swoole_set_process_name('php-email-sync-list'); | ||
| 12 | // 循环阻塞 | 13 | // 循环阻塞 |
| 13 | while (true){ | 14 | while (true){ |
| 14 | 15 | ||
| 15 | - if (time() - $start_time > 86400){ break; } | 16 | + if (time() - $start_time > 43200){ |
| 17 | + @file_put_contents('sync_run.log',"进程停止 ".system("kill ".getmypid()),FILE_APPEND); | ||
| 18 | + break; | ||
| 19 | + } | ||
| 16 | 20 | ||
| 17 | if($goNum > 50){ | 21 | if($goNum > 50){ |
| 18 | co::sleep(0.5); | 22 | co::sleep(0.5); |
-
请 注册 或 登录 后发表评论