petter2025 commited on
Commit
a7a98db
·
verified ·
1 Parent(s): 3e5b6a9

Update healing_policies.py

Browse files
Files changed (1) hide show
  1. healing_policies.py +2 -1
healing_policies.py CHANGED
@@ -1,3 +1,4 @@
 
1
  from models import HealingPolicy, HealingAction, EventSeverity
2
  from typing import Dict, List
3
 
@@ -57,7 +58,7 @@ class PolicyEngine:
57
 
58
  # Check cooldown
59
  policy_key = f"{policy.name}_{event.component}"
60
- current_time = datetime.datetime.now().timestamp()
61
  last_exec = self.last_execution.get(policy_key, 0)
62
 
63
  if current_time - last_exec < policy.cool_down_seconds:
 
1
+ import datetime # ← ADD THIS IMPORT
2
  from models import HealingPolicy, HealingAction, EventSeverity
3
  from typing import Dict, List
4
 
 
58
 
59
  # Check cooldown
60
  policy_key = f"{policy.name}_{event.component}"
61
+ current_time = datetime.datetime.now().timestamp() # ← THIS NEEDS datetime IMPORT
62
  last_exec = self.last_execution.get(policy_key, 0)
63
 
64
  if current_time - last_exec < policy.cool_down_seconds: