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
stop trying to return rows we don't have
mia.omg.lol
1 year ago
285d97f4
3dc6f5bb
+11
-4
2 changed files
expand all
collapse all
unified
split
consumer
src
indexer
db.rs
mod.rs
+5
-1
consumer/src/indexer/db.rs
···
106
106
.await
107
107
}
108
108
109
109
-
pub async fn delete_follow(conn: &mut AsyncPgConnection, at_uri: &str) -> QueryResult<String> {
109
109
+
pub async fn delete_follow(
110
110
+
conn: &mut AsyncPgConnection,
111
111
+
at_uri: &str,
112
112
+
) -> QueryResult<Option<String>> {
110
113
diesel::delete(schema::follows::table)
111
114
.filter(schema::follows::at_uri.eq(at_uri))
112
115
.returning(schema::follows::subject)
113
116
.get_result(conn)
114
117
.await
118
118
+
.optional()
115
119
}
116
120
117
121
pub async fn update_follow_stats(
+6
-3
consumer/src/indexer/mod.rs
···
178
178
match collection {
179
179
CollectionType::BskyBlock => db::delete_block(conn, &full_path).await?,
180
180
CollectionType::BskyFollow => {
181
181
-
let subject = db::delete_follow(conn, &full_path).await?;
182
182
-
db::update_follow_stats(conn, &[repo, &subject]).await?
183
183
-
},
181
181
+
if let Some(subject) = db::delete_follow(conn, &full_path).await? {
182
182
+
db::update_follow_stats(conn, &[repo, &subject]).await?
183
183
+
} else {
184
184
+
0
185
185
+
}
186
186
+
}
184
187
_ => unreachable!(),
185
188
};
186
189
} else {