改名
This commit is contained in:
@@ -48,7 +48,7 @@ class CrontabProcess extends Process
|
|||||||
while (true) {
|
while (true) {
|
||||||
$list = $this->channel->pop(-1);
|
$list = $this->channel->pop(-1);
|
||||||
if (isset($list['isLoop']) && isset($list['tick']) && $list['isLoop'] == 1) {
|
if (isset($list['isLoop']) && isset($list['tick']) && $list['isLoop'] == 1) {
|
||||||
$redis->zAdd('system:crontab', 0, time() + $list['tick'], serialize($list));
|
$redis->zAdd('system:crontab', time() + $list['tick'], serialize($list));
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
call_user_func($list['handler'], $list['params'] ?? null);
|
call_user_func($list['handler'], $list['params'] ?? null);
|
||||||
@@ -73,8 +73,8 @@ class CrontabProcess extends Process
|
|||||||
$score = time();
|
$score = time();
|
||||||
$redis = Snowflake::app()->getRedis();
|
$redis = Snowflake::app()->getRedis();
|
||||||
|
|
||||||
$lists = $redis->zRangeByScore('system:crontab', $score, $score);
|
$lists = $redis->zRangeByScore('system:crontab', (string)$score, (string)$score);
|
||||||
$redis->zRemRangeByScore('system:crontab', $score, $score);
|
$redis->zRemRangeByScore('system:crontab', (string)$score, (string)$score);
|
||||||
|
|
||||||
$barrier = Barrier::make();
|
$barrier = Barrier::make();
|
||||||
foreach ($lists as $list) {
|
foreach ($lists as $list) {
|
||||||
|
|||||||
Reference in New Issue
Block a user