diff options
-rw-r--r-- | etc/inc/captiveportal.inc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/etc/inc/captiveportal.inc b/etc/inc/captiveportal.inc index 497b6f1..5e834ca 100644 --- a/etc/inc/captiveportal.inc +++ b/etc/inc/captiveportal.inc @@ -1340,11 +1340,13 @@ function captiveportal_opendb() { try { $DB = new SQLite3($db_path); + $DB->busyTimeout(60000); } catch (Exception $e) { captiveportal_syslog("Could not open {$db_path} as an sqlite database for {$cpzone}. Error message: " . $e->getMessage() . " -- Trying again."); unlink_if_exists($db_path); try { $DB = new SQLite3($db_path); + $DB->busyTimeout(60000); } catch (Exception $e) { captiveportal_syslog("Still could not open {$db_path} as an sqlite database for {$cpzone}. Error message: " . $e->getMessage() . " -- Remove the database file manually and ensure there is enough free space."); return; @@ -1355,6 +1357,7 @@ function captiveportal_opendb() { captiveportal_syslog("Could not open {$db_path} as an sqlite database for {$cpzone}. Error message: {$DB->lastErrorMsg()}. Trying again."); unlink_if_exists($db_path); $DB = new SQLite3($db_path); + $DB->busyTimeout(60000); if (!$DB) { captiveportal_syslog("Still could not open {$db_path} as an sqlite database for {$cpzone}. Error message: {$DB->lastErrorMsg()}. Remove the database file manually and ensure there is enough free space."); return; @@ -1369,6 +1372,7 @@ function captiveportal_opendb() { unset($DB); unlink_if_exists($db_path); $DB = new SQLite3($db_path); + $DB->busyTimeout(60000); if ($DB->exec($createquery)) { captiveportal_syslog("Successfully reinitialized tables for {$cpzone} -- database has been reset."); } else { |