Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于优雅退出:OnShutDown #1243

Closed
mylxy opened this issue Dec 2, 2024 · 1 comment
Closed

关于优雅退出:OnShutDown #1243

mylxy opened this issue Dec 2, 2024 · 1 comment
Labels
invalid issue invalid issue (not related to Hertz or described in document or not enough information provided) stale

Comments

@mylxy
Copy link

mylxy commented Dec 2, 2024

OnShutDown 是注册的方法,顺序并发调用,如果退出的方法存在依赖关系,如何处理呢?是否并发,决定权是否交于配置决定
使用场景:项目启动 onRun加载redis, 分布式ID (依赖redis),数据库(依赖分布式ID),退出时,先关闭数据库, 再关分布式ID,再关redis,这都是有顺序要求,目前只能注册一个OnShutDown,在这方法中依赖上述的逻辑进行关闭,感觉不太优雅

@github-actions github-actions bot added the invalid issue invalid issue (not related to Hertz or described in document or not enough information provided) label Dec 2, 2024
Copy link

github-actions bot commented Dec 2, 2024

This issue has been marked as invalid question, please give more information by following the issue template. The issue will be closed in 1 days if no further activity occurs.

@github-actions github-actions bot added the stale label Dec 2, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid issue invalid issue (not related to Hertz or described in document or not enough information provided) stale
Development

No branches or pull requests

1 participant