From 8ddca6303d0fe5f4e9698147dfc0d6a3c41097ea Mon Sep 17 00:00:00 2001 From: Aleksei Voronov Date: Fri, 18 Oct 2024 19:59:32 +0200 Subject: [PATCH] Bluesky blew through max int number of messages Well, end of an era I guess. Time to use a bigger (bigint) cursor. Interestingly enough, some of Rust parts were already using an i64, but others weren't. Huh. --- sql/04_change_cursor_type_to_bigint.sql | 1 + src/services/bluesky/client.rs | 2 +- src/services/database.rs | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 sql/04_change_cursor_type_to_bigint.sql diff --git a/sql/04_change_cursor_type_to_bigint.sql b/sql/04_change_cursor_type_to_bigint.sql new file mode 100644 index 0000000..8362449 --- /dev/null +++ b/sql/04_change_cursor_type_to_bigint.sql @@ -0,0 +1 @@ +ALTER TABLE SubscriptionState ALTER COLUMN cursor TYPE BIGINT; diff --git a/src/services/bluesky/client.rs b/src/services/bluesky/client.rs index 0d4fc81..30c6414 100644 --- a/src/services/bluesky/client.rs +++ b/src/services/bluesky/client.rs @@ -145,7 +145,7 @@ impl Bluesky { pub async fn subscribe_to_operations( &self, processor: &P, - cursor: Option, + cursor: Option, ) -> Result<()> { let url = match cursor { Some(cursor) => format!( diff --git a/src/services/database.rs b/src/services/database.rs index 1eedb49..c81c188 100644 --- a/src/services/database.rs +++ b/src/services/database.rs @@ -213,7 +213,7 @@ impl Database { .await?) } - pub async fn fetch_subscription_cursor(&self, host: &str, did: &str) -> Result> { + pub async fn fetch_subscription_cursor(&self, host: &str, did: &str) -> Result> { let mut params = Parameters::new(); Ok(query(