Skip to content

Commit

Permalink
omicron-process: only use cachedir if we are going to use it
Browse files Browse the repository at this point in the history
  • Loading branch information
duncanmmacleod committed Jun 18, 2018
1 parent 1a588d8 commit b92c0ab
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions bin/omicron-process
Original file line number Diff line number Diff line change
Expand Up @@ -601,10 +601,11 @@ dataspan = type(segs)([segments.Segment(datastart, dataend)])
if args.cache_file:
with open(args.cache_file, 'r') as fobj:
cache = Cache.fromfile(fobj)
elif args.use_dev_shm:
elif args.use_dev_shm and len(segs): # only cache if we have state segments
cache = data.find_frames(ifo, frametype, datastart, dataend,
on_gaps='warn', tmpdir=cachedir)
tempfiles.extend(cache.pfnlist())
# remove cached files at end of process
tempfiles.extend(filter(lambda p: cachedir in p, cache.pfnlist()))
# find frames using datafind
else:
cache = data.find_frames(ifo, frametype, datastart, dataend,
Expand Down

0 comments on commit b92c0ab

Please sign in to comment.