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

feat: cancel the previous run when a new event occurs for the same PR #386

Merged
merged 1 commit into from
Sep 25, 2024

Conversation

wwcchh0123
Copy link
Contributor

@wwcchh0123 wwcchh0123 commented Sep 23, 2024

fix #177

Copy link

netlify bot commented Sep 23, 2024

Deploy Preview for reviewbot-x ready!

Name Link
🔨 Latest commit 75e59b4
🔍 Latest deploy log https://app.netlify.com/sites/reviewbot-x/deploys/66f2a21e7d17f70008ec61e4
😎 Deploy Preview https://deploy-preview-386--reviewbot-x.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codecov bot commented Sep 23, 2024

Codecov Report

Attention: Patch coverage is 8.88889% with 41 lines in your changes missing coverage. Please review.

Project coverage is 35.75%. Comparing base (878265c) to head (75e59b4).
Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
server.go 0.00% 16 Missing ⚠️
internal/linters/linters.go 0.00% 7 Missing ⚠️
internal/storage/file.go 50.00% 3 Missing and 1 partial ⚠️
internal/linters/github.go 0.00% 3 Missing ⚠️
internal/linters/go/golangci_lint/golangci_lint.go 0.00% 2 Missing ⚠️
internal/linters/c/cppcheck/cppcheck.go 0.00% 1 Missing ⚠️
internal/linters/doc/note-check/note.go 0.00% 1 Missing ⚠️
internal/linters/go/gofmt/gofmt.go 0.00% 1 Missing ⚠️
internal/linters/go/gomodcheck/gomodcheck.go 0.00% 1 Missing ⚠️
internal/linters/go/staticcheck/staticcheck.go 0.00% 1 Missing ⚠️
... and 4 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #386      +/-   ##
==========================================
- Coverage   36.01%   35.75%   -0.27%     
==========================================
  Files          27       27              
  Lines        2335     2358      +23     
==========================================
+ Hits          841      843       +2     
- Misses       1369     1390      +21     
  Partials      125      125              

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

@wwcchh0123 wwcchh0123 force-pushed the cancle_pre_run branch 2 times, most recently from 2bedc6b to 8edd44c Compare September 24, 2024 07:32
internal/linters/linters.go Outdated Show resolved Hide resolved

defer func() {
select {
case <-ctx.Done():
Copy link
Contributor

Choose a reason for hiding this comment

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

这一句在这里应该没意义

Copy link
Contributor

Choose a reason for hiding this comment

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

defer 里面单纯的加个 delete 逻辑就好,应该不需要select

Copy link
Contributor Author

Choose a reason for hiding this comment

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

当前一个事件的ctx 被取消,还是会执行defer func 内容,若不加 select ,即每次都会进行delete删除,导致该PR map内容为空,不符合预期

server.go Outdated Show resolved Hide resolved
server.go Outdated Show resolved Hide resolved
@CarlJi CarlJi merged commit 63dbad2 into qiniu:master Sep 25, 2024
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Proposal: cancel the previous run when a new event occurs for the same Pull Request (PR).
2 participants