tangled
alpha
login
or
join now
parakeet.at
/
parakeet
63
fork
atom
Parakeet is a Rust-based Bluesky AppServer aiming to implement most of the functionality required to support the Bluesky client
appview
atproto
bluesky
rust
appserver
63
fork
atom
overview
issues
12
pulls
pipelines
fix(did-resolver): speed increases to handle resolution
mia.omg.lol
9 months ago
2a756bea
2ae37e26
+7
-5
3 changed files
expand all
collapse all
unified
split
Cargo.lock
did-resolver
Cargo.toml
src
lib.rs
+1
Cargo.lock
···
942
942
"serde",
943
943
"serde_json",
944
944
"thiserror 2.0.11",
945
945
+
"tokio",
945
946
]
946
947
947
948
[[package]]
+2
-1
did-resolver/Cargo.toml
···
8
8
reqwest = { version = "0.12.12", features = ["json", "native-tls"] }
9
9
serde = { version = "1.0.217", features = ["derive"] }
10
10
serde_json = "1.0.134"
11
11
-
thiserror = "2.0.11"
11
11
+
thiserror = "2.0.11"
12
12
+
tokio = { version = "1.42", features = ["macros"] }
+4
-4
did-resolver/src/lib.rs
···
112
112
113
113
pub async fn resolve_handle(&self, handle: &str) -> Result<Option<String>, Error> {
114
114
// we want one of these to succeed
115
115
-
let http = self.resolve_handle_http(handle).await;
116
116
-
let dns = self.resolve_handle_dns(handle).await;
115
115
+
let http = self.resolve_handle_http(handle);
116
116
+
let dns = self.resolve_handle_dns(handle);
117
117
118
118
-
match (http, dns) {
118
118
+
match tokio::join!(http, dns) {
119
119
(Ok(http), Ok(dns)) => Ok(dns.or(http)),
120
120
(http, dns) => http.or(dns),
121
121
}
···
135
135
}
136
136
137
137
async fn resolve_handle_dns(&self, handle: &str) -> Result<Option<String>, Error> {
138
138
-
let res = match self.dns.txt_lookup(format!("_atproto.{handle}")).await {
138
138
+
let res = match self.dns.txt_lookup(format!("_atproto.{handle}.")).await {
139
139
Ok(txt) => txt,
140
140
Err(err) => {
141
141
return match err.kind() {