mirror of
https://github.com/scsibug/nostr-rs-relay.git
synced 2024-11-22 00:59:07 -05:00
fix: run postgres migration on startup
This commit is contained in:
parent
16f6e974c8
commit
25752abe6b
|
@ -62,9 +62,13 @@ async fn build_postgres_pool(settings: &Settings, metrics: NostrMetrics) -> Post
|
|||
.connect_with(options)
|
||||
.await
|
||||
.unwrap();
|
||||
PostgresRepo::new(pool, metrics, PostgresRepoSettings {
|
||||
let repo = PostgresRepo::new(pool, metrics, PostgresRepoSettings {
|
||||
cleanup_contact_list: true
|
||||
})
|
||||
});
|
||||
if let Ok(version) = repo.migrate_up().await {
|
||||
info!("Postgres migration completed, at v{}", version);
|
||||
}
|
||||
repo
|
||||
}
|
||||
|
||||
/// Spawn a database writer that persists events to the `SQLite` store.
|
||||
|
|
Loading…
Reference in New Issue
Block a user