add last_commit file for monitoring when a rule last completed

This commit is contained in:
Daniel Thornton 2015-04-07 10:41:01 -07:00
Родитель 32c2c002f0
Коммит 81b39ad5ce
2 изменённых файлов: 5 добавлений и 0 удалений

Просмотреть файл

@ -63,6 +63,7 @@ def run_rule_async(rule_name, settings):
if rule.retry:
# Failed before, however, ran successfully this time. Clean up fail/retry files
pid.clean_up(pid_dir, rule)
pid.create_last_complete(pid_dir, rule)
finally:
pid.remove_pid(pid_dir, rule)
os._exit(0)

Просмотреть файл

@ -38,6 +38,10 @@ def should_run(pid_dir, rule):
return False
def create_last_complete(pid_dir, rule):
Datefile(pid_dir, "%s.last_complete" % rule.name, timestamp=datetime.utcnow())
def create_last_run(pid_dir, rule):
Datefile(pid_dir, "%s.last_run" % rule.name, timestamp=datetime.utcnow())