summaryrefslogtreecommitdiff
path: root/azurelinuxagent/ga/monitor.py
diff options
context:
space:
mode:
Diffstat (limited to 'azurelinuxagent/ga/monitor.py')
-rw-r--r--azurelinuxagent/ga/monitor.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/azurelinuxagent/ga/monitor.py b/azurelinuxagent/ga/monitor.py
index 7ef7f04..dcfd6a4 100644
--- a/azurelinuxagent/ga/monitor.py
+++ b/azurelinuxagent/ga/monitor.py
@@ -178,11 +178,11 @@ class MonitorHandler(object):
logger.error("{0}", e)
def daemon(self):
- last_heartbeat = datetime.datetime.min
period = datetime.timedelta(minutes=30)
+ last_heartbeat = datetime.datetime.utcnow() - period
while True:
- if (datetime.datetime.now() - last_heartbeat) > period:
- last_heartbeat = datetime.datetime.now()
+ if datetime.datetime.utcnow() >= (last_heartbeat + period):
+ last_heartbeat = datetime.datetime.utcnow()
add_event(
op=WALAEventOperation.HeartBeat,
name=CURRENT_AGENT,