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
|
Date.replace("/", "-") + '-birdnet-' + Time + audiofmt
|
||||||
|
|
||||||
#Connect to SQLite Database
|
#Connect to SQLite Database
|
||||||
|
for attempt_number in range(3):
|
||||||
try:
|
try:
|
||||||
con = sqlite3.connect(userDir + '/BirdNET-Pi/scripts/birds.db')
|
con = sqlite3.connect(userDir + '/BirdNET-Pi/scripts/birds.db')
|
||||||
cur = con.cursor()
|
cur = con.cursor()
|
||||||
@@ -363,6 +364,7 @@ def handle_client(conn, addr):
|
|||||||
|
|
||||||
con.commit()
|
con.commit()
|
||||||
con.close()
|
con.close()
|
||||||
|
break
|
||||||
except:
|
except:
|
||||||
print("Database busy")
|
print("Database busy")
|
||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
|
|||||||
Reference in New Issue
Block a user