kopia lustrzana https://github.com/simonw/datasette
Ensure sqlite_timelimit correctly clears handler
If an error occurred inside the block the progress handler (used to enforce a time limit) was not being correctly cleared, resulting in timeout errors potentially occurring during subsequent SQL queries. The fix is described here: https://docs.python.org/3/library/contextlib.html#contextlib.contextmanagerpull/443/head
rodzic
11b352b4d5
commit
bac4e01f40
|
@ -152,8 +152,10 @@ def sqlite_timelimit(conn, ms):
|
|||
return 1
|
||||
|
||||
conn.set_progress_handler(handler, n)
|
||||
yield
|
||||
conn.set_progress_handler(None, n)
|
||||
try:
|
||||
yield
|
||||
finally:
|
||||
conn.set_progress_handler(None, n)
|
||||
|
||||
|
||||
class InvalidSql(Exception):
|
||||
|
|
Ładowanie…
Reference in New Issue