diff options
author | Paul Sherwood <paul.sherwood@codethink.co.uk> | 2016-04-25 09:18:41 +0100 |
---|---|---|
committer | Paul Sherwood <paul.sherwood@codethink.co.uk> | 2016-04-25 09:18:41 +0100 |
commit | 6bacc95e4002210064b8cda4da89bf750912b227 (patch) | |
tree | 13e26ed1547788afce31872fb262fbfb654734ca /kbas | |
parent | eafb0fe17cab75aea688b503e7761c11d380e4ca (diff) | |
download | ybd-6bacc95e4002210064b8cda4da89bf750912b227.tar.gz |
Use os.stat(x).st_atime, no need to touch files for access time
Diffstat (limited to 'kbas')
-rwxr-xr-x | kbas/__main__.py | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/kbas/__main__.py b/kbas/__main__.py index 3e14be1..c5330cf 100755 --- a/kbas/__main__.py +++ b/kbas/__main__.py @@ -71,7 +71,7 @@ class KeyedBinaryArtifactServer(object): names = glob.glob(os.path.join(app.config['artifact-dir'], '*' + name + '*')) try: - content = [[strftime('%y-%m-%d', gmtime(os.path.getctime(x))), + content = [[strftime('%y-%m-%d', gmtime(os.stat(x).st_atime)), cache.check(os.path.basename(x)), os.path.basename(x)] for x in names] except: @@ -88,16 +88,12 @@ class KeyedBinaryArtifactServer(object): def get_morph_artifact(): f = request.query.filename path = os.path.join(app.config['artifact-dir'], f) - if os.path.exists(path): - call(['touch', path]) return static_file(f, root=app.config['artifact-dir'], download=True) @bottle.get('/get/<cache_id>') def get_artifact(cache_id): f = os.path.join(cache_id, cache_id) path = os.path.join(app.config['artifact-dir'], f) - if os.path.exists(path): - call(['touch', os.path.dirname(path)]) return static_file(f, root=app.config['artifact-dir'], download=True) @bottle.get('/') |