1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-11-20 12:02:22 +03:00

Reimplementation of a postgres-backed storage with a shared PG listener

This commit is contained in:
Quentin Gliech
2023-07-17 17:36:37 +02:00
parent 3f17e2215c
commit 68db56c2a2
15 changed files with 540 additions and 95 deletions

View File

@@ -28,6 +28,7 @@ use rand::{distributions::Uniform, Rng};
use tracing::info;
use crate::{
storage::PostgresStorageFactory,
utils::{metrics_layer, trace_layer},
JobContextExt, State,
};
@@ -96,8 +97,9 @@ pub(crate) fn register(
suffix: &str,
monitor: Monitor<TokioExecutor>,
state: &State,
storage_factory: &PostgresStorageFactory,
) -> Monitor<TokioExecutor> {
let storage = state.store();
let storage = storage_factory.build();
let worker_name = format!("{job}-{suffix}", job = VerifyEmailJob::NAME);
let worker = WorkerBuilder::new(worker_name)
.layer(state.inject())