From 9ff6f2986d4a23df801b24aa74615d7f90b04db5 Mon Sep 17 00:00:00 2001 From: martinko Date: Fri, 10 Oct 2014 15:50:38 +0200 Subject: [PATCH] moved log msg about script's normal shutdown from BaseScript to DataMaintainer I think this could be useful to others but it's got to move until a better solution is figured out. --- python/skytools/scripting.py | 2 +- scripts/data_maintainer.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/python/skytools/scripting.py b/python/skytools/scripting.py index 24dd684b..b7a7a8e4 100644 --- a/python/skytools/scripting.py +++ b/python/skytools/scripting.py @@ -671,7 +671,7 @@ class BaseScript(object): In case of daemon, if will be called in same process as work(), unlike __init__(). """ - self.log.info("Script finished, exiting") + pass # define some aliases (short-cuts / backward compatibility cruft) stat_add = stat_put # Old, deprecated function. diff --git a/scripts/data_maintainer.py b/scripts/data_maintainer.py index e59b99c2..122f5e14 100755 --- a/scripts/data_maintainer.py +++ b/scripts/data_maintainer.py @@ -339,6 +339,10 @@ class DataMaintainer (skytools.DBScript): self.log.info(text, self.total_count, datetime.timedelta(0, round(time.time() - self.started))) self.lap_time = time.time() + def shutdown(self): + super(DataMaintainer, self).shutdown() + self.log.info("Script finished, exiting") + if __name__ == '__main__': script = DataMaintainer(sys.argv[1:]) -- 2.39.5