Source code for gryphon.execution.lib.heartbeat

"""
A bare-bones wrapper class that allows us to turn off heartbeating if we don't want it.
"""

import subprocess


[docs]class Heartbeat(object): def __init__(self, is_active=False): self.is_active = is_active
[docs] def heartbeat(self, heartbeat_key): if self.is_active is True: filename = 'monit/heartbeat/%s.txt' % heartbeat_key subprocess.call(['touch', filename])