Skip to content

Commit 73c9928

Browse files
committed
Add some comments
1 parent 806c284 commit 73c9928

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

coderd/audit/request.go

+3
Original file line numberDiff line numberDiff line change
@@ -274,10 +274,13 @@ func InitRequestWithCancel[T Auditable](w http.ResponseWriter, p *RequestParams)
274274
req, commitF := InitRequest[T](w, p)
275275
cancelled := false
276276
return req, func(commit bool) {
277+
// Once 'commit=false' is called, block
278+
// any future commit attempts.
277279
if !commit {
278280
cancelled = true
279281
return
280282
}
283+
// If it was ever cancelled, block any commits
281284
if !cancelled {
282285
commitF()
283286
}

0 commit comments

Comments
 (0)