mirror of
https://github.com/clash-verge-rev/clash-verge-rev
synced 2025-05-05 05:23:44 +08:00
fix: Can not use specify update time when create profile
This commit is contained in:
parent
5b7e29b8ad
commit
9b6b250cbd
@ -171,6 +171,7 @@ impl PrfItem {
|
|||||||
let with_proxy = opt_ref.map_or(false, |o| o.with_proxy.unwrap_or(false));
|
let with_proxy = opt_ref.map_or(false, |o| o.with_proxy.unwrap_or(false));
|
||||||
let self_proxy = opt_ref.map_or(false, |o| o.self_proxy.unwrap_or(false));
|
let self_proxy = opt_ref.map_or(false, |o| o.self_proxy.unwrap_or(false));
|
||||||
let user_agent = opt_ref.and_then(|o| o.user_agent.clone());
|
let user_agent = opt_ref.and_then(|o| o.user_agent.clone());
|
||||||
|
let update_interval = opt_ref.and_then(|o| o.update_interval);
|
||||||
|
|
||||||
let mut builder = reqwest::ClientBuilder::new().use_rustls_tls().no_proxy();
|
let mut builder = reqwest::ClientBuilder::new().use_rustls_tls().no_proxy();
|
||||||
|
|
||||||
@ -262,17 +263,21 @@ impl PrfItem {
|
|||||||
}
|
}
|
||||||
None => None,
|
None => None,
|
||||||
};
|
};
|
||||||
|
let option = match update_interval {
|
||||||
// parse the profile-update-interval
|
Some(val) => Some(PrfOption {
|
||||||
let option = match header.get("profile-update-interval") {
|
update_interval: Some(val),
|
||||||
Some(value) => match value.to_str().unwrap_or("").parse::<u64>() {
|
..PrfOption::default()
|
||||||
Ok(val) => Some(PrfOption {
|
}),
|
||||||
update_interval: Some(val * 60), // hour -> min
|
None => match header.get("profile-update-interval") {
|
||||||
..PrfOption::default()
|
Some(value) => match value.to_str().unwrap_or("").parse::<u64>() {
|
||||||
}),
|
Ok(val) => Some(PrfOption {
|
||||||
Err(_) => None,
|
update_interval: Some(val * 60), // hour -> min
|
||||||
|
..PrfOption::default()
|
||||||
|
}),
|
||||||
|
Err(_) => None,
|
||||||
|
},
|
||||||
|
None => None,
|
||||||
},
|
},
|
||||||
None => None,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
let uid = help::get_uid("r");
|
let uid = help::get_uid("r");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user