Check trigger strange
This commit is contained in:
@@ -154,16 +154,19 @@ func (p *Planner) Check(resourceID string, instanceID string, req *ResourceReque
|
|||||||
|
|
||||||
slots, ok := p.Schedule[resourceID]
|
slots, ok := p.Schedule[resourceID]
|
||||||
if !ok {
|
if !ok {
|
||||||
|
fmt.Println("CHECK1", true)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
fmt.Println("CHECK2", len(slots))
|
||||||
for _, slot := range slots {
|
for _, slot := range slots {
|
||||||
// Only consider slots on the same instance
|
// Only consider slots on the same instance
|
||||||
if slot.InstanceID != instanceID {
|
if slot.InstanceID != instanceID {
|
||||||
|
fmt.Println("CHECK3 MISS", slot.InstanceID, instanceID)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
// Only consider overlapping slots
|
// Only consider overlapping slots
|
||||||
if !slot.Start.Before(*end) || !slot.End.After(start) {
|
if !slot.Start.Before(*end) || !slot.End.After(start) {
|
||||||
|
fmt.Println("CHECK4 MISS", slot.Start, slot.End, start, end)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
// If capacity is unknown (reqPct empty), any overlap blocks the slot.
|
// If capacity is unknown (reqPct empty), any overlap blocks the slot.
|
||||||
|
|||||||
Reference in New Issue
Block a user