tangled
alpha
login
or
join now
microcosm.blue
/
microcosm-rs
64
fork
atom
Constellation, Spacedust, Slingshot, UFOs: atproto crates and services for microcosm
64
fork
atom
overview
issues
8
pulls
2
pipelines
only try to hydrate 100 records
bad-example.com
1 month ago
ad6cc268
f1f0d858
+40
-15
1 changed file
expand all
collapse all
unified
split
slingshot
src
server.rs
+40
-15
slingshot/src/server.rs
···
866
866
867
867
let t0 = Instant::now();
868
868
869
869
-
for link in links {
869
869
+
for (i, link) in links.into_iter().enumerate() {
870
870
match link {
871
871
MatchedRef::AtUri(parts) => {
872
872
let non_canonical_url = parts.to_uri();
···
886
886
.query_pairs_mut()
887
887
.append_pair("cid", &cid.as_ref().to_string());
888
888
}
889
889
-
records.insert(
890
890
-
non_canonical_url.clone(),
891
891
-
Hydration::Pending(ProxyHydrationPending {
892
892
-
reason: "deadline".to_string(),
893
893
-
follow_up: follow_up.to_string(),
894
894
-
}),
895
895
-
);
889
889
+
890
890
+
if i >= 100 {
891
891
+
records.insert(
892
892
+
non_canonical_url.clone(),
893
893
+
Hydration::Pending(ProxyHydrationPending {
894
894
+
reason: "limit".to_string(),
895
895
+
follow_up: follow_up.to_string(),
896
896
+
}),
897
897
+
);
898
898
+
continue;
899
899
+
} else {
900
900
+
records.insert(
901
901
+
non_canonical_url.clone(),
902
902
+
Hydration::Pending(ProxyHydrationPending {
903
903
+
reason: "deadline".to_string(),
904
904
+
follow_up: follow_up.to_string(),
905
905
+
}),
906
906
+
);
907
907
+
}
908
908
+
896
909
let tx = tx.clone();
897
910
let identity = self.identity.clone();
898
911
let repo = self.repo.clone();
···
1006
1019
.query_pairs_mut()
1007
1020
.append_pair("identifier", &identifier);
1008
1021
1009
1009
-
identifiers.insert(
1010
1010
-
identifier.clone(),
1011
1011
-
Hydration::Pending(ProxyHydrationPending {
1012
1012
-
reason: "deadline".to_string(),
1013
1013
-
follow_up: follow_up.to_string(),
1014
1014
-
}),
1015
1015
-
);
1022
1022
+
if i >= 100 {
1023
1023
+
identifiers.insert(
1024
1024
+
identifier.clone(),
1025
1025
+
Hydration::Pending(ProxyHydrationPending {
1026
1026
+
reason: "limit".to_string(),
1027
1027
+
follow_up: follow_up.to_string(),
1028
1028
+
}),
1029
1029
+
);
1030
1030
+
continue;
1031
1031
+
} else {
1032
1032
+
identifiers.insert(
1033
1033
+
identifier.clone(),
1034
1034
+
Hydration::Pending(ProxyHydrationPending {
1035
1035
+
reason: "deadline".to_string(),
1036
1036
+
follow_up: follow_up.to_string(),
1037
1037
+
}),
1038
1038
+
);
1039
1039
+
}
1040
1040
+
1016
1041
let tx = tx.clone();
1017
1042
let identity = self.identity.clone();
1018
1043
tokio::task::spawn(async move {