mirror of
https://github.com/telemt/telemt.git
synced 2026-04-19 03:24:10 +03:00
- fix: fmt issues
This commit is contained in:
@@ -440,7 +440,7 @@ async fn run_update_cycle(
|
|||||||
match download_proxy_secret_with_max_len_via_upstream(
|
match download_proxy_secret_with_max_len_via_upstream(
|
||||||
cfg.general.proxy_secret_len_max,
|
cfg.general.proxy_secret_len_max,
|
||||||
upstream,
|
upstream,
|
||||||
cfg.general.proxy_secret_url.as_deref()
|
cfg.general.proxy_secret_url.as_deref(),
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -37,7 +37,11 @@ pub(super) fn validate_proxy_secret_len(data_len: usize, max_len: usize) -> Resu
|
|||||||
|
|
||||||
/// Fetch Telegram proxy-secret binary.
|
/// Fetch Telegram proxy-secret binary.
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
pub async fn fetch_proxy_secret(cache_path: Option<&str>, max_len: usize, proxy_secret_url: Option<&str>) -> Result<Vec<u8>> {
|
pub async fn fetch_proxy_secret(
|
||||||
|
cache_path: Option<&str>,
|
||||||
|
max_len: usize,
|
||||||
|
proxy_secret_url: Option<&str>,
|
||||||
|
) -> Result<Vec<u8>> {
|
||||||
fetch_proxy_secret_with_upstream(cache_path, max_len, proxy_secret_url, None).await
|
fetch_proxy_secret_with_upstream(cache_path, max_len, proxy_secret_url, None).await
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -51,7 +55,8 @@ pub async fn fetch_proxy_secret_with_upstream(
|
|||||||
let cache = cache_path.unwrap_or("proxy-secret");
|
let cache = cache_path.unwrap_or("proxy-secret");
|
||||||
|
|
||||||
// 1) Try fresh download first.
|
// 1) Try fresh download first.
|
||||||
match download_proxy_secret_with_max_len_via_upstream(max_len, upstream, proxy_secret_url).await {
|
match download_proxy_secret_with_max_len_via_upstream(max_len, upstream, proxy_secret_url).await
|
||||||
|
{
|
||||||
Ok(data) => {
|
Ok(data) => {
|
||||||
if let Err(e) = tokio::fs::write(cache, &data).await {
|
if let Err(e) = tokio::fs::write(cache, &data).await {
|
||||||
warn!(error = %e, "Failed to cache proxy-secret (non-fatal)");
|
warn!(error = %e, "Failed to cache proxy-secret (non-fatal)");
|
||||||
|
|||||||
Reference in New Issue
Block a user