Skip to content

Commit

Permalink
Cleanup in logs.py
Browse files Browse the repository at this point in the history
  • Loading branch information
micheles committed Jun 7, 2024
1 parent 89a5d2e commit 54da8dd
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions openquake/commonlib/logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,12 +217,9 @@ def __init__(self, job_ini, calc_id, log_level='info', log_file=None,
if os.path.exists(path): # sanity check on the calculation ID
raise RuntimeError('There is a pre-existing file %s' % path)
self.usedb = True
elif calc_id == -1:
# only works in single-user situations
self.calc_id = get_last_calc_id() + 1
self.usedb = False
else:
# assume the calc_id was alreay created in the db
assert calc_id > 0, calc_id
self.calc_id = calc_id
self.usedb = True

Expand Down

0 comments on commit 54da8dd

Please sign in to comment.