This commit is contained in:
as2252258@163.com
2021-03-22 00:25:35 +08:00
parent 187731c30b
commit be4b5597ee
2 changed files with 5 additions and 1 deletions
+1 -1
View File
@@ -33,7 +33,7 @@ class Crontab extends Component
$redis->set('crontab:' . $name, serialize($crontab)); $redis->set('crontab:' . $name, serialize($crontab));
$tickTime = time() + $crontab->getTickTime() * 1000; $tickTime = time() + $crontab->getTickTime();
$redis->zAdd(self::CRONTAB_KEY, $tickTime, $crontab->getName()); $redis->zAdd(self::CRONTAB_KEY, $tickTime, $crontab->getName());
} }
+4
View File
@@ -38,6 +38,10 @@ class CrontabProcess extends Process
*/ */
public function onHandler(\Swoole\Process $process): void public function onHandler(\Swoole\Process $process): void
{ {
$redis = Snowflake::app()->getRedis();
$redis->del(ACrontab::CRONTAB_KEY);
$redis->release();
Timer::tick(1000, function () { Timer::tick(1000, function () {
$startTime = time(); $startTime = time();