From 3ffdfcb57ee7343bd459f136c1e98f9c69b28c7f Mon Sep 17 00:00:00 2001 From: Raul Alvarado Date: Sun, 11 Jul 2021 22:50:05 -0400 Subject: [PATCH 1/2] Update version values for release 7.2.0 --- scale/scale/__init__.py | 2 +- scale/scale/__init__.py.template | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scale/scale/__init__.py b/scale/scale/__init__.py index 8b93a2f21..a573cafb8 100644 --- a/scale/scale/__init__.py +++ b/scale/scale/__init__.py @@ -9,7 +9,7 @@ 'version_info_t', ('major', 'minor', 'patch', 'qualifier'), ) -VERSION = version_info_t(7, 2, 0, '-snapshot') +VERSION = version_info_t(7, 2, 0, '') __version__ = '{0.major}.{0.minor}.{0.patch}{0.qualifier}'.format(VERSION) diff --git a/scale/scale/__init__.py.template b/scale/scale/__init__.py.template index 3a276a026..3779fba88 100644 --- a/scale/scale/__init__.py.template +++ b/scale/scale/__init__.py.template @@ -9,7 +9,7 @@ version_info_t = namedtuple( 'version_info_t', ('major', 'minor', 'patch', 'qualifier'), ) -VERSION = version_info_t(7, 2, 0, '-snapshot___BUILDNUM___') +VERSION = version_info_t(7, 2, 0, '___BUILDNUM___') __version__ = '{0.major}.{0.minor}.{0.patch}{0.qualifier}'.format(VERSION) From b1a8b7fb842416d47673aa154da873efec6602d7 Mon Sep 17 00:00:00 2001 From: Raul Alvarado Date: Tue, 13 Jul 2021 09:53:28 -0400 Subject: [PATCH 2/2] moved job creation logic into the loop --- scale/ingest/models.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/scale/ingest/models.py b/scale/ingest/models.py index 2b67e96dc..e6f297e2e 100644 --- a/scale/ingest/models.py +++ b/scale/ingest/models.py @@ -318,18 +318,18 @@ def start_ingest_tasks(self, ingests, scan_id=None, strike_id=None): else: raise Exception('One of scan_id or strike_id must be set') - data = Data() - data.add_value(JsonValue('ingest_id', ingest_id)) - data.add_value(JsonValue('workspace', ingest.workspace.name)) - if ingest.new_workspace: - data.add_value(JsonValue('new_workspace', ingest.new_workspace.name)) - - ingest_job = None - with transaction.atomic(): + data = Data() + data.add_value(JsonValue('ingest_id', ingest_id)) + data.add_value(JsonValue('workspace', ingest.workspace.name)) + if ingest.new_workspace: + data.add_value(JsonValue('new_workspace', ingest.new_workspace.name)) + + ingest_job = None ingest_job = Queue.objects.queue_new_job_v6(ingest_job_type, data, event) - ingest.job = ingest_job - ingest.status = 'QUEUED' - ingest.save() + with transaction.atomic(): + ingest.job = ingest_job + ingest.status = 'QUEUED' + ingest.save() logger.debug('Successfully created ingest task for %s', ingest.file_name)