Added DATBASE_TIMEOUT constant to allow customizing database wait time
This commit is contained in:
parent
6a6d73168b
commit
3fc0ba3a63
3 changed files with 3 additions and 2 deletions
|
@ -74,7 +74,7 @@ class PostgreSQL extends DBEngine
|
|||
} else {
|
||||
$db->exec("SET application_name TO 'shimmie [local]';");
|
||||
}
|
||||
$db->exec("SET statement_timeout TO 10000;");
|
||||
$db->exec("SET statement_timeout TO ".DATABASE_TIMEOUT.";");
|
||||
}
|
||||
|
||||
public function scoreql_to_sql(string $data): string
|
||||
|
|
|
@ -27,6 +27,7 @@ function _d(string $name, $value): void
|
|||
}
|
||||
_d("DATABASE_DSN", null); // string PDO database connection details
|
||||
_d("DATABASE_KA", true); // string Keep database connection alive
|
||||
_d("DATABASE_TIMEOUT", 10000); // string Keep database connection alive
|
||||
_d("CACHE_DSN", null); // string cache connection details
|
||||
_d("DEBUG", false); // boolean print various debugging details
|
||||
_d("DEBUG_SQL", false); // boolean dump SQL queries to data/sql.log
|
||||
|
|
|
@ -73,7 +73,7 @@ class Rule34 extends Extension
|
|||
global $database, $page, $user;
|
||||
|
||||
if ($user->can("delete_user")) { // deleting users can take a while
|
||||
$database->execute("SET statement_timeout TO 25000;");
|
||||
$database->execute("SET statement_timeout TO ".(DATABASE_TIMEOUT+15000).";");
|
||||
}
|
||||
|
||||
if (function_exists("sd_notify_watchdog")) {
|
||||
|
|
Reference in a new issue