Skip to content

Commit 2dd76d9

Browse files
committed
Fix attribute name
1 parent bd6300d commit 2dd76d9

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/gort/overwatcher/alerts.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,10 @@ async def is_safe(self) -> tuple[bool, ActiveAlert]:
187187
active_alerts = ActiveAlert(0)
188188

189189
# Keep track of how long the overwatcher has been idle.
190-
if self.overwatcher.state.idle and self.overwaidle_since == 0:
191-
self.overwaidle_since = time()
190+
if self.overwatcher.state.idle and self.overwatcher_idle_since == 0:
191+
self.overwatcher_idle_since = time()
192192
elif not self.overwatcher.state.idle:
193-
self.overwaidle_since = 0
193+
self.overwatcher_idle_since = 0
194194

195195
if self.alerts_data_unavailable:
196196
self.log.warning("Alerts data is unavailable.")
@@ -265,7 +265,10 @@ async def is_safe(self) -> tuple[bool, ActiveAlert]:
265265
# If it's safe to observe but we have been idle for a while, we
266266
# raise an alert but do not change the is_safe status.
267267
timeout = self.overwatcher.config["overwatcher.alerts.idle_timeout"] or 600
268-
if self.overwaidle_since > 0 and (time() - self.overwaidle_since) > timeout:
268+
if (
269+
self.overwatcher_idle_since > 0
270+
and (time() - self.overwatcher_idle_since) > timeout
271+
):
269272
await self.notify(
270273
f"Overwatcher has been idle for over {timeout:.0f} s.",
271274
min_time_between_repeat_notifications=300,

0 commit comments

Comments
 (0)