mirror of
https://github.com/scsibug/nostr-rs-relay.git
synced 2024-12-23 08:55:51 -05:00
improvement: extend allowed wal_checkpoint timeout to 10 sec
This commit is contained in:
parent
b23b3ce8ec
commit
d2adddaee4
|
@ -721,7 +721,7 @@ pub async fn db_checkpoint_task(pool: SqlitePool, safe_to_read: Arc<Mutex<u64>>)
|
|||
// default threshold for the busy timer
|
||||
let busy_wait_default = Duration::from_secs(1);
|
||||
// if the WAL file is getting too big, switch to this
|
||||
let busy_wait_default_long = Duration::from_secs(5);
|
||||
let busy_wait_default_long = Duration::from_secs(10);
|
||||
loop {
|
||||
tokio::select! {
|
||||
_ = tokio::time::sleep(Duration::from_secs(CHECKPOINT_FREQ_SEC)) => {
|
||||
|
|
|
@ -689,7 +689,8 @@ async fn nostr_server(
|
|||
if s.needs_historical_events() {
|
||||
{
|
||||
// acquire and immediately release lock; this ensures we do not start new queries during a wal checkpoint.
|
||||
let _ = safe_to_read.lock().await;
|
||||
let _ = safe_to_read.lock().await;
|
||||
trace!("passed safe_to_read lock");
|
||||
}
|
||||
// start a database query. this spawns a blocking database query on a worker thread.
|
||||
db::db_query(s, cid.to_owned(), pool.clone(), query_tx.clone(), abandon_query_rx).await;
|
||||
|
|
Loading…
Reference in New Issue
Block a user