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

refactor: optimize the update method for the number of tag associated with posts #5422

Merged
merged 2 commits into from Mar 12, 2024

Conversation

guqing
Copy link
Member

@guqing guqing commented Feb 29, 2024

What type of PR is this?

/kind improvement
/area core

What this PR does / why we need it:

优化标签关联的文章数量的更新方式以降低标签太多时对 CPU 的消耗

how to test it?
测试文章关联标签、取消关联、更新关联、删除文章到回收站、彻底删除文章时标签对应的文章可见文章数量和所有文章数量是否正确

Does this PR introduce a user-facing change?

优化标签关联的文章数量的更新方式以降低标签太多时对 CPU 的消耗

@f2c-ci-robot f2c-ci-robot bot added kind/improvement Categorizes issue or PR as related to a improvement. release-note Denotes a PR that will be considered when it comes time to generate release notes. area/core Issues or PRs related to the Halo Core labels Feb 29, 2024
@f2c-ci-robot f2c-ci-robot bot requested review from LIlGG and ruibaby February 29, 2024 08:34
Copy link

codecov bot commented Feb 29, 2024

Codecov Report

Attention: Patch coverage is 31.25000% with 77 lines in your changes are missing coverage. Please review.

Project coverage is 56.69%. Comparing base (5fdf6c0) to head (b450ce8).
Report is 50 commits behind head on main.

Files Patch % Lines
...java/run/halo/app/content/TagPostCountUpdater.java 22.97% 57 Missing ⚠️
...o/app/core/extension/reconciler/TagReconciler.java 63.63% 7 Missing and 1 partial ⚠️
...java/run/halo/app/event/post/PostDeletedEvent.java 0.00% 5 Missing ⚠️
...ain/java/run/halo/app/infra/SchemeInitializer.java 37.50% 5 Missing ⚠️
.../java/run/halo/app/core/extension/content/Tag.java 0.00% 1 Missing ⚠️
.../app/core/extension/reconciler/PostReconciler.java 50.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #5422      +/-   ##
============================================
- Coverage     56.91%   56.69%   -0.22%     
- Complexity     3319     3334      +15     
============================================
  Files           587      591       +4     
  Lines         18968    19185     +217     
  Branches       1401     1392       -9     
============================================
+ Hits          10795    10877      +82     
- Misses         7594     7731     +137     
+ Partials        579      577       -2     

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

Copy link

sonarcloud bot commented Feb 29, 2024

Quality Gate Passed Quality Gate passed

Issues
1 New issue
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.3% Duplication on New Code

See analysis details on SonarCloud

@guqing
Copy link
Member Author

guqing commented Mar 4, 2024

/milestone 2.14.x

@f2c-ci-robot f2c-ci-robot bot added this to the 2.14.x milestone Mar 4, 2024
Copy link
Member

@LIlGG LIlGG left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@f2c-ci-robot f2c-ci-robot bot added the lgtm Indicates that a PR is ready to be merged. label Mar 11, 2024
Copy link
Member

@ruibaby ruibaby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

经过实际测试,文章关联标签、取消关联、更新关联、删除文章到回收站、彻底删除文章等操作之后,后台显示的数量和前台显示的数量均符合预期。

Copy link

f2c-ci-robot bot commented Mar 12, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ruibaby

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@f2c-ci-robot f2c-ci-robot bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 12, 2024
@f2c-ci-robot f2c-ci-robot bot merged commit ed23914 into halo-dev:main Mar 12, 2024
8 checks passed
@guqing guqing deleted the refactor/tag-reconciler branch March 12, 2024 03:18
@ruibaby ruibaby modified the milestones: 2.14.x, 2.14.0 Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/core Issues or PRs related to the Halo Core kind/improvement Categorizes issue or PR as related to a improvement. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants