From 54da8dda67a921a7c5f423d9d667ff2b2a9f42fa Mon Sep 17 00:00:00 2001 From: Michele Simionato Date: Fri, 7 Jun 2024 11:16:00 +0200 Subject: [PATCH] Cleanup in logs.py --- openquake/commonlib/logs.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/openquake/commonlib/logs.py b/openquake/commonlib/logs.py index 67a0326df1a2..88df4e040569 100644 --- a/openquake/commonlib/logs.py +++ b/openquake/commonlib/logs.py @@ -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