Skip to content

Commit

Permalink
Check at the beginning of store if another is ongoing
Browse files Browse the repository at this point in the history
We shouldn't wait for file storage to notice that another storage with
the same name is already going.
Fixes Ericsson#1013
  • Loading branch information
bruntib committed Oct 17, 2017
1 parent ccc4165 commit 3fca315
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions libcodechecker/server/api/report_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -1719,6 +1719,15 @@ def getMissingContentHashes(self, file_hashes):
def massStoreRun(self, name, tag, version, b64zip, force):
self.__require_store()

try:
session = self.__Session()
run = session.query(Run).filter(Run.name == name).one_or_none()

if run and self.__storage_session.has_ongoing_run(run.id):
raise Exception('Storage of ' + name + ' is already going!')
finally:
session.close()

# Unzip sent data.
zip_dir = unzip(b64zip)

Expand Down

0 comments on commit 3fca315

Please sign in to comment.