Skip to content

Commit

Permalink
refactor(rotation): update comments for lookForWork and updateRotatio…
Browse files Browse the repository at this point in the history
…n functions for clarity
  • Loading branch information
mastercactapus committed Feb 11, 2025
1 parent 13933da commit 532494b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion engine/rotationmanager/lookforwork.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type LookForWorkArgs struct{}

func (LookForWorkArgs) Kind() string { return "rotation-manager-lfw" }

// cleanup is a worker function that will remove any stale subscriptions.
// lookForWork will schedule jobs for rotations in the entity_updates table.
func (db *DB) lookForWork(ctx context.Context, j *river.Job[LookForWorkArgs]) error {
var hadWork bool
err := db.lock.WithTxShared(ctx, func(ctx context.Context, tx *sql.Tx) error {
Expand Down
2 changes: 1 addition & 1 deletion engine/rotationmanager/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const (
PriorityLFW = 4
)

var _ processinglock.Setupable = &DB{}
var _ processinglock.Setupable = (*DB)(nil) // assert that DB implements processinglock.Setupable

// Setup implements processinglock.Setupable.
func (db *DB) Setup(ctx context.Context, args processinglock.SetupArgs) error {
Expand Down
2 changes: 1 addition & 1 deletion engine/rotationmanager/updaterotation.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type UpdateArgs struct {

func (UpdateArgs) Kind() string { return "rotation-manager-update" }

// cleanup is a worker function that will remove any stale subscriptions.
// updateRotation updates the state of a single rotation, and schedules a job for the next rotation time.
func (db *DB) updateRotation(ctx context.Context, j *river.Job[UpdateArgs]) error {
return db.lock.WithTxShared(ctx, func(ctx context.Context, tx *sql.Tx) error {
g := gadb.New(tx)
Expand Down

0 comments on commit 532494b

Please sign in to comment.