diff options
author | Kim Alvefur <zash@zash.se> | 2020-05-02 14:13:02 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2020-05-02 14:13:02 +0200 |
commit | 75a3d7758bda32792bb3abe412b12f8c85bf757f (patch) | |
tree | 0452db4e7e5a5d111274c635099ff54c71bcf337 | |
parent | 7369538232b41b98872b5bf45759fc19d6293727 (diff) | |
download | prosody-75a3d7758bda32792bb3abe412b12f8c85bf757f.tar.gz prosody-75a3d7758bda32792bb3abe412b12f8c85bf757f.zip |
mod_storage_sql: Log database connection parameters when creating engine
This is meant to help trace down an issue where Prosody apparently
creates multiple conflicting SQL engines, causing problems especially
with SQLite3, e.g. #616 #784.
-rw-r--r-- | plugins/mod_storage_sql.lua | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/mod_storage_sql.lua b/plugins/mod_storage_sql.lua index 21556715..30e38d49 100644 --- a/plugins/mod_storage_sql.lua +++ b/plugins/mod_storage_sql.lua @@ -759,9 +759,10 @@ function module.load() if prosody.prosodyctl then return; end local engines = module:shared("/*/sql/connections"); local params = normalize_params(module:get_option("sql", default_params)); - engine = engines[sql.db2uri(params)]; + local db_uri = sql.db2uri(params); + engine = engines[db_uri]; if not engine then - module:log("debug", "Creating new engine"); + module:log("debug", "Creating new engine %s", db_uri); engine = sql:create_engine(params, function (engine) -- luacheck: ignore 431/engine if module:get_option("sql_manage_tables", true) then -- Automatically create table, ignore failure (table probably already exists) |