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

Write to global variable once to prevent data races #29

Merged
merged 1 commit into from
Oct 8, 2022
Merged

Write to global variable once to prevent data races #29

merged 1 commit into from
Oct 8, 2022

Conversation

pscheid92
Copy link
Contributor

@pscheid92 pscheid92 commented Oct 8, 2022

Before:
We write to the global variable 'headerXRequestID' on every request. This leads to data races and a slight slowdown for each request.

After:
We write to the global variable 'headerXRequestID' once during the setup of the middleware.

For more details see issue #24

Before:
We write to the global variable 'headerXRequestID' on every request.
This leads to data races and a slight slowdown for each request.

After:
We write to the global variable 'headerXRequestID' once during the
setup of the middleware.
@appleboy appleboy added the bug Something isn't working label Oct 8, 2022
@codecov-commenter
Copy link

codecov-commenter commented Oct 8, 2022

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.28%. Comparing base (f9bc391) to head (291403b).
Report is 31 commits behind head on master.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #29      +/-   ##
==========================================
+ Coverage   94.11%   94.28%   +0.16%     
==========================================
  Files           2        2              
  Lines          34       35       +1     
==========================================
+ Hits           32       33       +1     
  Misses          2        2              
Flag Coverage Δ
go- 94.28% <100.00%> (+0.16%) ⬆️
go-1.14 94.28% <100.00%> (+0.16%) ⬆️
go-1.15 94.28% <100.00%> (+0.16%) ⬆️
go-1.16 94.28% <100.00%> (+0.16%) ⬆️
go-1.17 94.28% <100.00%> (+0.16%) ⬆️
go-1.18 94.28% <100.00%> (+0.16%) ⬆️
go-1.19 94.28% <100.00%> (?)
macos-latest 94.28% <100.00%> (+0.16%) ⬆️
ubuntu-latest 94.28% <100.00%> (+0.16%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@appleboy appleboy merged commit 1a81880 into gin-contrib:master Oct 8, 2022
@pscheid92 pscheid92 deleted the 24-fix-data-race branch October 8, 2022 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants