Skip to content
This repository was archived by the owner on Apr 26, 2021. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cuckoo/core/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,7 @@ def lock_machine(self, label=None, platform=None, tags=None):
raise CuckooOperationalError("No machines match selection criteria.")

# Get the first free machine.
machine = machines.filter_by(locked=False).first()
machine = machines.filter_by(locked=False).with_for_update().first()
except SQLAlchemyError as e:
log.exception("Database error locking machine: {0}".format(e))
session.close()
Expand Down