Skip to content

Commit

Permalink
app/dynamic_node_id: don't assume single-threading
Browse files Browse the repository at this point in the history
Let SQLite verify that for us instead of silently corrupting itself.
  • Loading branch information
tpwrules authored and tridge committed Nov 13, 2024
1 parent 5c2edbb commit 6805cf0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions dronecan/app/dynamic_node_id.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ class CentralizedServer(object):

class AllocationTable(object):
def __init__(self, path):
# Disabling same thread check on the assumption that the developer knows what they are doing.
self.db = sqlite3.connect(path, check_same_thread=False) # @UndefinedVariable
self.db = sqlite3.connect(path) # @UndefinedVariable

self._modify('''CREATE TABLE IF NOT EXISTS `allocation` (
`node_id` INTEGER NOT NULL UNIQUE,
Expand Down

0 comments on commit 6805cf0

Please sign in to comment.