From 4fb0b5a09b26135ade285844da5d7dfe582a8d4c Mon Sep 17 00:00:00 2001 From: Ɓukasz 'sil2100' Zemczak Date: Thu, 18 May 2017 19:58:02 +0200 Subject: Import patches-unapplied version 2.2.12-0ubuntu1 to ubuntu/artful-proposed Imported using git-ubuntu import. Changelog parent: 473ad6fbfe0b9c3b362b530492928303f2b4c7f3 New changelog entries: * New upstream release (LP: #1690854). - Refreshed debian/patches/disable_import_test.patch. --- azurelinuxagent/ga/monitor.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'azurelinuxagent/ga/monitor.py') 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, -- cgit v1.2.3