Skip to content
Snippets Groups Projects
Commit 6e5d0d16 authored by Janne Mareike Koschinski's avatar Janne Mareike Koschinski
Browse files

Fixes timeout options

parent 6d6b225e
Branches
No related tags found
No related merge requests found
......@@ -27,12 +27,13 @@ class Config
public static function createFromGlobals()
{
$options = [];
if (defined(qrs_db_option_tsqueryfunction) && null !== qrs_db_option_tsqueryfunction)
if (defined('qrs_db_option_tsqueryfunction') && (null !== qrs_db_option_tsqueryfunction)) {
$options['tsqueryfunction'] = qrs_db_option_tsqueryfunction;
}
$options['timeout'] = (defined(qrs_db_option_timeout) && null !== qrs_db_option_timeout) ? qrs_db_option_timeout : 5000;
$options['timeout'] = (defined('qrs_db_option_timeout') && (null !== qrs_db_option_timeout)) ? qrs_db_option_timeout : 5000;
if (defined(qrs_db_connector) && null !== qrs_db_connector)
if (defined('qrs_db_connector') && null !== qrs_db_connector)
return new Config(qrs_path_prefix, qrs_db_connector, qrs_db_user, qrs_db_pass, qrs_backend, $options);
else
return new Config(qrs_path_prefix, 'pgsql:host=' . qrs_db_host . ';port=' . qrs_db_port . ';dbname=' . qrs_db_name . '', qrs_db_user, qrs_db_pass, qrs_backend, $options);
......
......@@ -11,7 +11,7 @@ define('qrs_db_pass', 'password');
define('qrs_db_option_tsqueryfunction', "plainto_tsquery('english', :query)");
// Timeout in milliseconds
define('qrs_db_option_timeout', 5000);
define('qrs_db_option_timeout', 1);
define('qrs_backend', 'pgsql-smart');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment