Skip to content

Commit

Permalink
Merge pull request #609 from oda-hub/check-sratch_dir-existsg
Browse files Browse the repository at this point in the history
Check sratch dir existsg
  • Loading branch information
burnout87 authored Oct 20, 2023
2 parents f5703b5 + ce1259e commit 78054d5
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions cdci_data_analysis/flask_app/dispatcher_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,16 +473,18 @@ def inspect_state(app):
if job_id is not None:
if r.group('job_id')[:8] != job_id:
continue

if (time_.time() - os.stat(scratch_dir).st_mtime) < recent_days * 24 * 3600:
records.append(dict(
mtime=os.stat(scratch_dir).st_mtime,
ctime=os.stat(scratch_dir).st_ctime,
session_id=r.group('session_id'),
job_id=r.group('job_id'),
aliased_marker=r.group('aliased_marker'),
**InstrumentQueryBackEnd.read_scratch_dir(scratch_dir)
))
if os.path.exists(scratch_dir):
if (time_.time() - os.stat(scratch_dir).st_mtime) < recent_days * 24 * 3600:
records.append(dict(
mtime=os.stat(scratch_dir).st_mtime,
ctime=os.stat(scratch_dir).st_ctime,
session_id=r.group('session_id'),
job_id=r.group('job_id'),
aliased_marker=r.group('aliased_marker'),
**InstrumentQueryBackEnd.read_scratch_dir(scratch_dir)
))
else:
logger.warning(f"scratch_dir {scratch_dir} not existing, cannot be inspected")

logger.info("found records: %s", len(records))

Expand Down

0 comments on commit 78054d5

Please sign in to comment.