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

fix(backend): ServerStatsService start within running app #11342

Closed

Conversation

ZerglingGo
Copy link
Contributor

What

Daemon service ServerStatsService can start/stop when updating enableServerMachineStats

Why

When changes enableServerMachineStats and save it, that not take effect in real-time.
Only after restarting the server will the settings take effect.

Additional info (optional)

Related commit: af3258d

Checklist

  • Read the contribution guide
  • Test working in a local environment
  • (If needed) Add story of storybook
  • (If needed) Update CHANGELOG.md
  • (If possible) Add tests

@github-actions github-actions bot added the packages/backend Server side specific issue/PR label Jul 21, 2023
@github-actions github-actions bot requested review from acid-chicken and tamaina July 21, 2023 19:12
@codecov
Copy link

codecov bot commented Jul 21, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.10% ⚠️

Comparison is base (44985ae) 78.89% compared to head (573af1b) 78.80%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #11342      +/-   ##
===========================================
- Coverage    78.89%   78.80%   -0.10%     
===========================================
  Files          925      174     -751     
  Lines        97587    22751   -74836     
  Branches      7749      511    -7238     
===========================================
- Hits         76993    17928   -59065     
+ Misses       20594     4823   -15771     

see 751 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@syuilo
Copy link
Member

syuilo commented Aug 24, 2023

各エンドポイントには具体的な処理を書きたくないので、

public async update(data: Partial<MiMeta>): Promise<MiMeta> {
内に書くと良さそう

@ZerglingGo ZerglingGo force-pushed the fix/server-stats-live-update branch from f1dd20d to 4d71ad5 Compare September 18, 2023 13:45
@ZerglingGo
Copy link
Contributor Author

@syuilo Please check the last commit

@syuilo
Copy link
Member

syuilo commented Sep 24, 2023

CoreModuleからDaemonに依存するのは少し厄介になりそうなので、実装は今のままにし、UIで「サーバーの再起動が必要になります」と表示するようにします🙏

@syuilo syuilo closed this Sep 24, 2023
@ZerglingGo
Copy link
Contributor Author

@syuilo では、Redis Subscriberを利用するのはどうでしょうか?

https://github.com/ZerglingGo/misskey/blob/84db3b730a3d82b6c2cf390ec1809e8c95154b0d/packages/backend/src/daemons/ServerStatsService.ts#L38-L56

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
packages/backend Server side specific issue/PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants