prevent run multiple notification job

This commit is contained in:
2026-06-06 14:56:13 +07:00
parent 74a37320fe
commit 9f639baf1b
2 changed files with 12 additions and 6 deletions

View File

@@ -99,12 +99,15 @@ class Nostr {
suspend fun emitContactListUpdate(contacts: List<PublicKey>) =
_contactListUpdates.emit(contacts)
suspend fun init(dbPath: String) {
suspend fun init(
dbPath: String,
logLevel: LogLevel = LogLevel.WARN
) {
try {
if (isInitialized.value) return
// Initialize the logger for nostr client
initLogger(LogLevel.DEBUG)
initLogger(logLevel)
// Initialize the database and gossip instance
val lmdb = NostrDatabase.lmdb(dbPath)