mirror of
https://github.com/SeriousBug/gandi-live-dns-rust
synced 2025-09-03 18:18:33 -05:00
use a single threaded executor
This commit is contained in:
parent
e4938a3f95
commit
8572014c10
|
@ -43,7 +43,7 @@ async fn get_ip(api_url: &str) -> anyhow::Result<String> {
|
||||||
Ok(text)
|
Ok(text)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main(flavor = "current_thread")]
|
||||||
async fn main() -> anyhow::Result<()> {
|
async fn main() -> anyhow::Result<()> {
|
||||||
let opts = opts::Opts::parse();
|
let opts = opts::Opts::parse();
|
||||||
let conf = config::load_config(&opts)
|
let conf = config::load_config(&opts)
|
||||||
|
@ -87,7 +87,7 @@ async fn main() -> anyhow::Result<()> {
|
||||||
map.insert("rrset_values", vec![ip]);
|
map.insert("rrset_values", vec![ip]);
|
||||||
let req = client.put(url).json(&map);
|
let req = client.put(url).json(&map);
|
||||||
let task_governor = governor.clone();
|
let task_governor = governor.clone();
|
||||||
let task = tokio::task::spawn(async move {
|
let task = tokio::task::spawn_local(async move {
|
||||||
task_governor.until_ready_with_jitter(retry_jitter).await;
|
task_governor.until_ready_with_jitter(retry_jitter).await;
|
||||||
println!("Updating {}", &fqdn);
|
println!("Updating {}", &fqdn);
|
||||||
match req.send().await {
|
match req.send().await {
|
||||||
|
|
Loading…
Reference in a new issue