mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-13 13:37:31 -07:00
Fix antenna migration for redis servers with password protection
This commit is contained in:
parent
04a1bd9363
commit
3f7d26a0e3
1 changed files with 7 additions and 5 deletions
|
@ -42,13 +42,15 @@ async fn main() {
|
||||||
None => "redis",
|
None => "redis",
|
||||||
Some(_) => "rediss",
|
Some(_) => "rediss",
|
||||||
};
|
};
|
||||||
let redis_uri_userpass = match redis_conf.user {
|
let redis_user = redis_conf.user.unwrap_or("default".to_string());
|
||||||
None => "".to_string(),
|
let redis_uri_userpass = format!(
|
||||||
Some(user) => format!("{}:{}@", user, encode(&redis_conf.pass.unwrap_or_default())),
|
"{}:{}",
|
||||||
};
|
redis_user,
|
||||||
|
encode(&redis_conf.pass.unwrap_or_default())
|
||||||
|
);
|
||||||
let redis_uri_hostport = format!("{}:{}", redis_conf.host, redis_conf.port);
|
let redis_uri_hostport = format!("{}:{}", redis_conf.host, redis_conf.port);
|
||||||
let redis_uri = format!(
|
let redis_uri = format!(
|
||||||
"{}://{}{}/{}",
|
"{}://{}@{}/{}",
|
||||||
redis_proto, redis_uri_userpass, redis_uri_hostport, redis_conf.db
|
redis_proto, redis_uri_userpass, redis_uri_hostport, redis_conf.db
|
||||||
);
|
);
|
||||||
env::set_var(CACHE_URL_ENV, redis_uri);
|
env::set_var(CACHE_URL_ENV, redis_uri);
|
||||||
|
|
Loading…
Reference in a new issue