feat: readonly mode

This commit is contained in:
2024-11-26 15:11:12 +00:00
parent 76241cc08b
commit e6c3b4e063
6 changed files with 31 additions and 16 deletions

View File

@ -18,6 +18,7 @@ use std::time::Duration;
pub struct Settings {
pub db: String,
pub lnd: LndConfig,
pub read_only: bool,
}
#[derive(Debug, Deserialize, Serialize)]
@ -49,7 +50,7 @@ async fn main() -> Result<(), Error> {
}
let status = VmStateCache::new();
let mut worker = Worker::new(db.clone(), lnd.clone(), status.clone());
let mut worker = Worker::new(config.read_only, db.clone(), lnd.clone(), status.clone());
let sender = worker.sender();
tokio::spawn(async move {
loop {