Skip to content

多进程启动后定时任务会被执行多次 #218

Description

@majormj

当你用 Gunicorn 启动(workers=4)时,每个 worker 都会执行一次 FastAPI 应用的初始化流程,包括启动 scheduler → 导致 4 个调度器同时运行 → 任务重复执行 4 次。

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions