Skip to content

Commit acf0aeb

Browse files
authored
Allow specifying queue prefix (#2107)
2 parents edd8260 + 5b13108 commit acf0aeb

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

server/svix-server/src/cfg.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,11 @@ pub struct ConfigurationInner {
185185
/// The DSN for the Redis-backed queue. Overrides `redis_dsn`. (can be left empty if not using
186186
/// redis)
187187
pub queue_dsn: Option<String>,
188+
/// Optional prefix to use for the queue.
189+
///
190+
/// Allows multiple instances of svix-server to share a single queue backend
191+
/// without interfering with each other.
192+
pub queue_prefix: Option<String>,
188193

189194
/// What kind of cache to use. Supported: memory, redis (must have redis_dsn or cache_dsn
190195
/// configured), none.

server/svix-server/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ async fn graceful_shutdown_handler() {
101101

102102
pub async fn run(cfg: Configuration) {
103103
let _metrics = setup_metrics(&cfg);
104-
run_with_prefix(None, cfg, None).await
104+
run_with_prefix(cfg.queue_prefix.clone(), cfg, None).await
105105
}
106106

107107
#[derive(Clone)]

0 commit comments

Comments
 (0)