Add verification

This commit is contained in:
mr
2026-03-12 12:05:52 +01:00
parent 98fe2600b3
commit b9df0b2731
8 changed files with 275 additions and 64 deletions

View File

@@ -520,14 +520,14 @@ func collectBookingResources(wf *workflow.Workflow, selectedInstances workflow.C
func checkResourceAvailability(res []bookingResource, start time.Time, end *time.Time) (unavailable []string, warnings []string) {
for _, r := range res {
plannerMu.RLock()
p := PlannerCache[r.peerID]
entry := PlannerCache[r.peerID]
plannerMu.RUnlock()
if p == nil {
if entry == nil || entry.Planner == nil {
warnings = append(warnings, fmt.Sprintf(
"peer %s planner not in cache for resource %s assuming available", r.peerID, r.id))
continue
}
if !checkInstance(p, r.id, r.instanceID, start, end) {
if !checkInstance(entry.Planner, r.id, r.instanceID, start, end) {
unavailable = append(unavailable, r.id)
warnings = append(warnings, fmt.Sprintf(
"resource %s is not available in [%s %s]",