Skip to content

Commit 517367b

Browse files
authored
Failed message retry (#448)
* Add failed to retry * Added retry job * Tests * Review fixes
1 parent 774423d commit 517367b

File tree

9 files changed

+583
-21
lines changed

9 files changed

+583
-21
lines changed

crates/bcr-ebill-api/src/persistence/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ use bcr_ebill_persistence::{
66
SurrealIdentityStore, SurrealNostrEventOffsetStore, SurrealNotificationStore,
77
bill::{BillChainStoreApi, BillStoreApi},
88
company::{CompanyChainStoreApi, CompanyStoreApi},
9+
db::nostr_send_queue::SurrealNostrEventQueueStore,
910
file_upload::FileUploadStoreApi,
1011
get_surreal_db,
1112
identity::{IdentityChainStoreApi, IdentityStoreApi},
13+
nostr::NostrQueuedMessageStoreApi,
1214
};
1315
use log::error;
1416
use std::sync::Arc;
@@ -39,6 +41,7 @@ pub struct DbContext {
3941
pub nostr_event_offset_store: Arc<dyn NostrEventOffsetStoreApi>,
4042
pub notification_store: Arc<dyn NotificationStoreApi>,
4143
pub backup_store: Arc<dyn BackupStoreApi>,
44+
pub queued_message_store: Arc<dyn NostrQueuedMessageStoreApi>,
4245
}
4346

4447
/// Creates a new instance of the DbContext with the given SurrealDB configuration.
@@ -77,6 +80,7 @@ pub async fn get_db_context(conf: &Config) -> bcr_ebill_persistence::Result<DbCo
7780
let nostr_event_offset_store = Arc::new(SurrealNostrEventOffsetStore::new(db.clone()));
7881
let notification_store = Arc::new(SurrealNotificationStore::new(db.clone()));
7982
let backup_store = Arc::new(SurrealBackupStore::new(db.clone()));
83+
let queued_message_store = Arc::new(SurrealNostrEventQueueStore::new(db.clone()));
8084

8185
Ok(DbContext {
8286
contact_store,
@@ -90,5 +94,6 @@ pub async fn get_db_context(conf: &Config) -> bcr_ebill_persistence::Result<DbCo
9094
nostr_event_offset_store,
9195
notification_store,
9296
backup_store,
97+
queued_message_store,
9398
})
9499
}

0 commit comments

Comments
 (0)