about summary refs log tree commit diff
path: root/src/webmentions/queue.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/webmentions/queue.rs')
-rw-r--r--src/webmentions/queue.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/webmentions/queue.rs b/src/webmentions/queue.rs
index b811e71..af1387f 100644
--- a/src/webmentions/queue.rs
+++ b/src/webmentions/queue.rs
@@ -1,7 +1,7 @@
-use std::{pin::Pin, str::FromStr};
+use std::pin::Pin;
 
 use futures_util::{Stream, StreamExt};
-use sqlx::{postgres::PgListener, Executor};
+use sqlx::{postgres::PgListener, ConnectOptions, Executor};
 use uuid::Uuid;
 
 use super::Webmention;
@@ -115,8 +115,8 @@ impl<T> Clone for PostgresJobQueue<T> {
 }
 
 impl PostgresJobQueue<Webmention> {
-    pub async fn new(uri: &str) -> Result<Self, sqlx::Error> {
-        let mut options = sqlx::postgres::PgConnectOptions::from_str(uri)?
+    pub async fn new(uri: &url::Url) -> Result<Self, sqlx::Error> {
+        let mut options = sqlx::postgres::PgConnectOptions::from_url(uri)?
             .options([("search_path", "kittybox_webmention")]);
         if let Ok(password_file) = std::env::var("PGPASS_FILE") {
             let password = tokio::fs::read_to_string(password_file).await.unwrap();