Remove CACHEDMESSAGES
This commit is contained in:
parent
078d2a0420
commit
56cadb71f6
10
src/lib.rs
10
src/lib.rs
@ -1,18 +1,8 @@
|
|||||||
#![allow(warnings)]
|
#![allow(warnings)]
|
||||||
use anyhow::Error;
|
use anyhow::Error;
|
||||||
use sdk_common::network::CachedMessage;
|
|
||||||
use sdk_common::MutexExt;
|
use sdk_common::MutexExt;
|
||||||
use std::sync::{Mutex, MutexGuard, OnceLock};
|
|
||||||
|
|
||||||
pub mod api;
|
pub mod api;
|
||||||
mod peers;
|
mod peers;
|
||||||
mod user;
|
mod user;
|
||||||
mod wallet;
|
mod wallet;
|
||||||
|
|
||||||
pub static CACHEDMESSAGES: OnceLock<Mutex<Vec<CachedMessage>>> = OnceLock::new();
|
|
||||||
|
|
||||||
pub fn lock_messages() -> Result<MutexGuard<'static, Vec<CachedMessage>>, Error> {
|
|
||||||
CACHEDMESSAGES
|
|
||||||
.get_or_init(|| Mutex::new(vec![]))
|
|
||||||
.lock_anyhow()
|
|
||||||
}
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user