1
0
Fork 0
mirror of https://gitlab.com/SIGBUS/nyaa.git synced 2024-12-22 14:40:00 +00:00

fix race condition?

This commit is contained in:
nyaadev 2017-05-23 15:18:17 +02:00
parent ba7e0a7c2e
commit 1b76eaea35
2 changed files with 2 additions and 4 deletions

View file

@ -240,11 +240,10 @@ def ghetto_import():
if not tracker:
tracker = models.Trackers(uri=announce)
db.session.add(tracker)
db.session.flush()
db_trackers.add(tracker)
db.session.flush()
# Store tracker refs in DB
for order, tracker in enumerate(db_trackers):
torrent_tracker = models.TorrentTrackers(torrent_id=torrent.id,

View file

@ -139,11 +139,10 @@ def handle_torrent_upload(upload_form, uploading_user=None, fromAPI=False):
if not tracker:
tracker = models.Trackers(uri=announce)
db.session.add(tracker)
db.session.flush()
db_trackers.add(tracker)
db.session.flush()
# Store tracker refs in DB
for order, tracker in enumerate(db_trackers):
torrent_tracker = models.TorrentTrackers(torrent_id=torrent.id,