mirror of
https://codeberg.org/icewind/nextcloud-config-parser.git
synced 2026-06-03 08:34:13 +02:00
handle redis db index as str
This commit is contained in:
parent
9ada18d5a6
commit
484af6a8e7
5 changed files with 31 additions and 3 deletions
|
|
@ -331,7 +331,11 @@ fn parse_redis_options(parsed: &Value, key: &str) -> RedisConfig {
|
|||
None
|
||||
};
|
||||
|
||||
let db = redis_options["dbindex"].clone().into_int().unwrap_or(0);
|
||||
let db = redis_options["dbindex"].clone().into_int().or_else(|| {
|
||||
redis_options["dbindex"]
|
||||
.as_str()
|
||||
.and_then(|i| i64::from_str(i).ok())
|
||||
}).unwrap_or(0);
|
||||
let password = redis_options["password"]
|
||||
.as_str()
|
||||
.filter(|pass| !pass.is_empty())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue