attempts to write to database thrice before moving on
This commit is contained in:
@@ -356,6 +356,7 @@ def handle_client(conn, addr):
|
||||
Date.replace("/", "-") + '-birdnet-' + Time + audiofmt
|
||||
|
||||
#Connect to SQLite Database
|
||||
for attempt_number in range(3):
|
||||
try:
|
||||
con = sqlite3.connect(userDir + '/BirdNET-Pi/scripts/birds.db')
|
||||
cur = con.cursor()
|
||||
@@ -363,6 +364,7 @@ def handle_client(conn, addr):
|
||||
|
||||
con.commit()
|
||||
con.close()
|
||||
break
|
||||
except:
|
||||
print("Database busy")
|
||||
time.sleep(2)
|
||||
|
||||
Reference in New Issue
Block a user