Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add some comments
  • Loading branch information
Emyrk committed Jul 19, 2024
commit 73c9928c77dee06a6c5f7cf3e9cab3e11f4fbf90
3 changes: 3 additions & 0 deletions coderd/audit/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,10 +274,13 @@ func InitRequestWithCancel[T Auditable](w http.ResponseWriter, p *RequestParams)
req, commitF := InitRequest[T](w, p)
cancelled := false
return req, func(commit bool) {
// Once 'commit=false' is called, block
// any future commit attempts.
if !commit {
cancelled = true
return
}
// If it was ever cancelled, block any commits
if !cancelled {
commitF()
}
Expand Down
Loading