diff options
author | martinko | 2014-10-10 13:50:38 +0000 |
---|---|---|
committer | martinko | 2014-10-27 09:33:47 +0000 |
commit | 9ff6f2986d4a23df801b24aa74615d7f90b04db5 (patch) | |
tree | 8571ad6eae73f7fdb6ae69c663223b1f0972e37f | |
parent | 3732b3ceec242ae7757c99762520fe547afc9aa9 (diff) |
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.
-rw-r--r-- | python/skytools/scripting.py | 2 | ||||
-rwxr-xr-x | scripts/data_maintainer.py | 4 |
2 files changed, 5 insertions, 1 deletions
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:]) |