diff options
author | Liutauras Adomaitis <adomaitis@kolabsys.com> | 2018-12-14 15:29:12 +0200 |
---|---|---|
committer | Liutauras Adomaitis <adomaitis@kolabsys.com> | 2018-12-14 17:31:39 +0200 |
commit | 063065448ad5a2e87d749849fc4fd74841d4bab1 (patch) | |
tree | a898aa1eb2ce08952ba55c877a37c83db23f2d02 | |
parent | 68bbebeb10ff8d3c78ff7f1121f646ebf27ee00a (diff) | |
download | pykolab-063065448ad5a2e87d749849fc4fd74841d4bab1.tar.gz |
Make wallace skip message files which are in locks directory
Summary: Wallace should not try to work with lock files
Test Plan: None
Reviewers: vanmeeuwen, machniak
Reviewed By: vanmeeuwen
Subscribers: petersen
Differential Revision: https://git.kolab.org/D708
-rw-r--r-- | wallace/__init__.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/wallace/__init__.py b/wallace/__init__.py index 5a2ffbd..6e79d97 100644 --- a/wallace/__init__.py +++ b/wallace/__init__.py @@ -286,11 +286,18 @@ class WallaceDaemon(object): filepath = os.path.join(root, filename) try: + # ignore calls on too young files if os.stat(filepath).st_mtime + 150 > time.time(): - log.debug("Skipping %s" % (filepath), level=8) + log.debug("File not more than 150s old. Skipping %s" % (filepath), level=8) continue - except: + # ignore calls on lock files + if '/locks/' in filepath: + log.debug("File is in locks directory. Skipping %s" % (filepath), level=8) + continue + + except Exception, errmsg: + log.error("Error: %s. Skipping %s" % (errmsg, filepath)) continue if not root == pickup_path: |