Skip to content

Commit a3d4163

Browse files
committed
refactor: remove unused UUID parsing function and simplify claimed status check in memory queue
1 parent c440d7d commit a3d4163

5 files changed

Lines changed: 482 additions & 8 deletions

File tree

apps/workspace-engine/pkg/events/handler/jobs/jobs.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,8 @@ import (
99
"workspace-engine/pkg/workspace"
1010

1111
"github.com/charmbracelet/log"
12-
"github.com/google/uuid"
1312
)
1413

15-
func isStringUUID(s string) bool {
16-
_, err := uuid.Parse(s)
17-
return err == nil
18-
}
19-
2014
func HandleJobUpdated(
2115
ctx context.Context,
2216
ws *workspace.Workspace,

apps/workspace-engine/pkg/reconcile/memory/memory.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ func (q *Queue) Enqueue(ctx context.Context, params reconcile.EnqueueParams) err
153153
s.ClaimedBy = ""
154154
s.ClaimedUntil = nil
155155
}
156-
if !(s.ClaimedUntil != nil && s.ClaimedUntil.After(now)) {
156+
if s.ClaimedUntil == nil || !s.ClaimedUntil.After(now) {
157157
s.UpdatedAt = now
158158
}
159159

apps/workspace-engine/pkg/workspace/releasemanager/policy/evaluator/approval/approval.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ type Getters interface {
4747

4848
type AnyApprovalEvaluator struct {
4949
getters Getters
50-
store *store.Store
5150
ruleId string
5251
ruleCreatedAt string
5352
rule *oapi.AnyApprovalRule

apps/workspace-engine/svc/controllers/deploymentresourceselectoreval/controller.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ func (c *Controller) Process(ctx context.Context, item reconcile.Item) error {
9090
}
9191
}
9292

93+
print("resourceMatchedIds", resourceMatchedIds)
94+
9395
return nil
9496
}
9597

0 commit comments

Comments
 (0)