mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-08 03:00:28 -04:00
fix(backend): document MySQL MAX_EXECUTION_TIME limitation for write queries
Add code comment noting that MySQL's MAX_EXECUTION_TIME only applies to SELECT statements; write operations rely on the database's wait_timeout.
This commit is contained in:
@@ -436,6 +436,9 @@ class SQLQueryBlock(Block):
|
||||
if read_only:
|
||||
conn.execute(text("SET default_transaction_read_only = ON"))
|
||||
elif engine.dialect.name == "mysql":
|
||||
# NOTE: MAX_EXECUTION_TIME only applies to SELECT statements.
|
||||
# Write queries (INSERT/UPDATE/DELETE) are not bounded by this
|
||||
# setting; they rely on the database's wait_timeout instead.
|
||||
conn.execute(
|
||||
text(f"SET SESSION MAX_EXECUTION_TIME = {timeout * 1000}")
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user