summaryrefslogtreecommitdiff
path: root/azurelinuxagent/ga/monitor.py
diff options
context:
space:
mode:
authorƁukasz 'sil2100' Zemczak <lukasz.zemczak@ubuntu.com>2017-05-18 19:58:02 +0200
committerusd-importer <ubuntu-server@lists.ubuntu.com>2017-05-31 09:53:12 +0000
commit68754fe67f1b3da2e6ca45885641941b3229698a (patch)
treea3c36f3a9ee56b4f0c77505dcf758f3e3436d884 /azurelinuxagent/ga/monitor.py
parent512b1e00ab9b75e46cc76af40c72cf239fa100e5 (diff)
parent6742198762e770442c4eb5d0eaa4a7a809f85424 (diff)
downloadvyos-walinuxagent-68754fe67f1b3da2e6ca45885641941b3229698a.tar.gz
vyos-walinuxagent-68754fe67f1b3da2e6ca45885641941b3229698a.zip
Import patches-applied version 2.2.12-0ubuntu1 to applied/ubuntu/artful-proposed
Imported using git-ubuntu import. Changelog parent: 512b1e00ab9b75e46cc76af40c72cf239fa100e5 Unapplied parent: 6742198762e770442c4eb5d0eaa4a7a809f85424 New changelog entries: * New upstream release (LP: #1690854). - Refreshed debian/patches/disable_import_test.patch.
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,