Skip to content

任务执行时间迟了一秒钟 #10

@he426100

Description

@he426100

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions