Software /
code /
prosody
Comparison
plugins/mod_storage_sql.lua @ 12592:d580e6a57cbb 0.12
mod_storage_sql: Fix bypass of load procedure under prosodyctl
There's no 'prosody.prosodyctl' property other than this one, introduced
in 6216743c188c in 2015.
Guessing that the intent was to skip this when running as a prosodyctl
command. The module.command code does its own version of this
initialization, so this seems likely.
Thanks raja for noticing
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Tue, 26 Jul 2022 00:39:16 +0200 |
parent | 11971:0b350909da24 |
child | 12595:0572b6e604a3 |
child | 12599:5aafcf6a0730 |
comparison
equal
deleted
inserted
replaced
12586:4c8941b5b05e | 12592:d580e6a57cbb |
---|---|
831 port = params.port; | 831 port = params.port; |
832 }; | 832 }; |
833 end | 833 end |
834 | 834 |
835 function module.load() | 835 function module.load() |
836 if prosody.prosodyctl then return; end | 836 if prosody.process_type == "prosodyctl" then return; end |
837 local engines = module:shared("/*/sql/connections"); | 837 local engines = module:shared("/*/sql/connections"); |
838 local params = normalize_params(module:get_option("sql", default_params)); | 838 local params = normalize_params(module:get_option("sql", default_params)); |
839 local db_uri = sql.db2uri(params); | 839 local db_uri = sql.db2uri(params); |
840 engine = engines[db_uri]; | 840 engine = engines[db_uri]; |
841 if not engine then | 841 if not engine then |