Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e3f7006

Browse files
committed
add some tx labels
1 parent c7e53cd commit e3f7006

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

coderd/autobuild/lifecycle_executor.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,10 @@ func (e *Executor) runOnce(t time.Time) Stats {
285285

286286
// Run with RepeatableRead isolation so that the build process sees the same data
287287
// as our calculation that determines whether an autobuild is necessary.
288-
}, &sql.TxOptions{Isolation: sql.LevelRepeatableRead})
288+
}, &database.TxOptions{
289+
Isolation: sql.LevelRepeatableRead,
290+
TxIdentifier: "lifecycle",
291+
})
289292
if auditLog != nil {
290293
// If the transition didn't succeed then updating the workspace
291294
// to indicate dormant didn't either.

coderd/templates.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ func (api *API) postTemplateByOrganization(rw http.ResponseWriter, r *http.Reque
467467
templateVersionAudit.New = newTemplateVersion
468468

469469
return nil
470-
}, nil)
470+
}, database.DefaultTXOptions().WithID("postTemplate"))
471471
if err != nil {
472472
httpapi.Write(ctx, rw, http.StatusInternalServerError, codersdk.Response{
473473
Message: "Internal error inserting template.",

0 commit comments

Comments
 (0)