Merge branch 'main' of gitlab.hackers.town:veilid/veilid
This commit is contained in:
commit
be48b13cf5
@ -3,7 +3,7 @@
|
|||||||
use crate::xx::*;
|
use crate::xx::*;
|
||||||
pub use async_executors::JoinHandle;
|
pub use async_executors::JoinHandle;
|
||||||
use async_executors::{AsyncStd, LocalSpawnHandleExt, SpawnHandleExt};
|
use async_executors::{AsyncStd, LocalSpawnHandleExt, SpawnHandleExt};
|
||||||
use async_std_resolver::{config, resolver, AsyncStdResolver};
|
use async_std_resolver::{config, resolver, resolver_from_system_conf, AsyncStdResolver};
|
||||||
use rand::prelude::*;
|
use rand::prelude::*;
|
||||||
use std::time::{Duration, SystemTime, UNIX_EPOCH};
|
use std::time::{Duration, SystemTime, UNIX_EPOCH};
|
||||||
|
|
||||||
@ -133,12 +133,15 @@ async fn get_resolver() -> Result<AsyncStdResolver, String> {
|
|||||||
if let Some(r) = &*resolver_lock {
|
if let Some(r) = &*resolver_lock {
|
||||||
Ok(r.clone())
|
Ok(r.clone())
|
||||||
} else {
|
} else {
|
||||||
let resolver = resolver(
|
let resolver = match resolver_from_system_conf().await {
|
||||||
|
Ok(v) => v,
|
||||||
|
Err(_) => resolver(
|
||||||
config::ResolverConfig::default(),
|
config::ResolverConfig::default(),
|
||||||
config::ResolverOpts::default(),
|
config::ResolverOpts::default(),
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
.expect("failed to connect resolver");
|
.expect("failed to connect resolver"),
|
||||||
|
};
|
||||||
|
|
||||||
*resolver_lock = Some(resolver.clone());
|
*resolver_lock = Some(resolver.clone());
|
||||||
Ok(resolver)
|
Ok(resolver)
|
||||||
|
Loading…
Reference in New Issue
Block a user