hyperf / hyperf/crontab

任务执行时间迟了一秒钟

Open
#10 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
13
Forks
13
PR merge metrics
No merged PRs in 30d

Description

比如`*/5 * * * * *`,本应该每5秒执行一次,也就是0秒、5秒、10秒...时间执行,实际时间为1秒、6秒、11秒...,跟踪了下代码,发现`Hyperf\Crontab\Strategy\Executor`的`execute`方法最后一行是`$callback && $this->timer->after($diff > 0 ? $diff : 1, $callback);`,不明白为什么这么设计,这不是跟预期不一致吗?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.