Skip to content

Commit e807d02

Browse files
refactor: remove DeterminePrebuildsState lock
1 parent eeb0407 commit e807d02

File tree

2 files changed

+0
-11
lines changed

2 files changed

+0
-11
lines changed

coderd/database/lock.go

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ const (
1313
LockIDNotificationsReportGenerator
1414
LockIDCryptoKeyRotation
1515
LockIDReconcileTemplatePrebuilds
16-
LockIDDeterminePrebuildsState
1716
)
1817

1918
// GenLockID generates a unique and consistent lock ID from a given string.

enterprise/coderd/prebuilds/reconcile.go

-10
Original file line numberDiff line numberDiff line change
@@ -230,16 +230,6 @@ func (c *StoreReconciler) SnapshotState(ctx context.Context, store database.Stor
230230
var state prebuilds.GlobalSnapshot
231231

232232
err := store.InTx(func(db database.Store) error {
233-
start := c.clock.Now()
234-
235-
// TODO: per-template ID lock?
236-
err := db.AcquireLock(ctx, database.LockIDDeterminePrebuildsState)
237-
if err != nil {
238-
return xerrors.Errorf("failed to acquire state determination lock: %w", err)
239-
}
240-
241-
c.logger.Debug(ctx, "acquired state determination lock", slog.F("acquire_wait_secs", fmt.Sprintf("%.4f", c.clock.Since(start).Seconds())))
242-
243233
presetsWithPrebuilds, err := db.GetTemplatePresetsWithPrebuilds(ctx, uuid.NullUUID{}) // TODO: implement template-specific reconciliations later
244234
if err != nil {
245235
return xerrors.Errorf("failed to get template presets with prebuilds: %w", err)

0 commit comments

Comments
 (0)