From d062095d10b730eec9bcc1526557d7218eaf35db Mon Sep 17 00:00:00 2001 From: Luis Perez Date: Wed, 18 Sep 2024 13:32:02 -0700 Subject: [PATCH] forgot to update recent_container_restart --- paasta_tools/kubernetes_tools.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/paasta_tools/kubernetes_tools.py b/paasta_tools/kubernetes_tools.py index 9f8730c7a0..6d553476bc 100644 --- a/paasta_tools/kubernetes_tools.py +++ b/paasta_tools/kubernetes_tools.py @@ -20,6 +20,7 @@ import os import re from datetime import datetime +from datetime import timezone from enum import Enum from functools import lru_cache from inspect import currentframe @@ -2947,7 +2948,7 @@ def recent_container_restart( last_timestamp: Optional[int], time_window_s: int = 900, # 15 mins ) -> bool: - min_timestamp = datetime.now().timestamp() - time_window_s + min_timestamp = datetime.now(timezone.utc).timestamp() - time_window_s return ( restart_count > 0 and last_state == "terminated"