8000 feat: code style for cache package by daheige · Pull Request #773 · polarismesh/polaris · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: code style for cache package #773

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

Merged

Conversation

daheige
Copy link
Member
@daheige daheige commented Oct 27, 2022

Please provide issue(s) of this PR:
Fixes #774
code style for cache package

@daheige
Copy link
Member Author
daheige commented Oct 27, 2022 via email

@chuntaojun
Copy link
Member

Here is the save operation. Grouping is reasonable. After the previous function is executed immediately, there is a lock behind it. The save operation is likely to cause a longer lock waiting time.

lock 处理的是 map[namespace]bucket 中关于bucket 的插入,一旦 bucket 插入完成,lock 的写锁本身就应该立即释放,而不是不断持有写锁直到 bucket 的插入操作完成

@daheige
Copy link
Member Author
daheige commented Oct 27, 2022 via email

@codecov
Copy link
codecov bot commented Oct 28, 2022

Codecov Report

Merging #773 (9c344c4) into main (c128a2a) will decrease coverage by 0.01%.
The diff coverage is 75.40%.

@@            Coverage Diff             @@
##             main     #773      +/-   ##
==========================================
- Coverage   56.29%   56.28%   -0.02%     
==========================================
  Files         159      159              
  Lines       28978    28958      -20     
==========================================
- Hits        16313    16298      -15     
+ Misses      10494    10492       -2     
+ Partials     2171     2168       -3     
Impacted Files Coverage Δ
cache/routing_config_bucket.go 66.99% <ø> (ø)
cache/service.go 83.51% <ø> (ø)
cache/routing_config_query.go 56.62% <27.27%> (-1.71%) ⬇️
cache/l5.go 8.96% <33.33%> (-2.34%) ⬇️
cache/config_file_bucket.go 69.74% <72.72%> (-0.99%) ⬇️
cache/config_file.go 72.97% <83.33%> (+1.16%) ⬆️
cache/instance.go 74.77% <83.33%> (+0.22%) ⬆️
cache/cache.go 79.90% <100.00%> (-0.10%) ⬇️
cache/namespace.go 77.33% <100.00%> (+0.41%) ⬆️
cache/ratelimit_config.go 81.67% <100.00%> (+2.13%) ⬆️
... and 13 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@chuntaojun chuntaojun added the code quality Prompt code readability, reduce repetitive code, improve code maintainability, code comment label Oct 28, 2022
@chuntaojun chuntaojun added this to the v1.13.0 milestone Oct 28, 2022
@chuntaojun chuntaojun merged commit c916a74 into polarismesh:main Oct 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code quality Prompt code readability, reduce repetitive code, improve code maintainability, code comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

code style for cache package
2 participants
0