Never ignore SQL errors when reading SOCKS5 settings

Otherwise we may accidentally connect directly due to temporary error.
This commit is contained in:
link2xt
2021-08-22 18:29:51 +00:00
parent ab1de69fbc
commit 3aa2b57ac1
5 changed files with 28 additions and 36 deletions

View File

@@ -63,10 +63,7 @@ impl Socks5Config {
pub async fn from_database(context: &Context) -> Result<Option<Self>> {
let sql = &context.sql;
let enabled = sql
.get_raw_config_bool("socks5_enabled")
.await
.unwrap_or(false);
let enabled = sql.get_raw_config_bool("socks5_enabled").await?;
if enabled {
let host = sql.get_raw_config("socks5_host").await?.unwrap_or_default();
let port: u16 = sql