add frontend threadpool to database

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2024-11-27 06:28:32 +00:00
parent 94d7b21cf0
commit c7ae951676
10 changed files with 362 additions and 57 deletions

View file

@ -1,5 +1,5 @@
use conduit::{err, Result};
use rocksdb::{Direction, IteratorMode};
use rocksdb::{Direction, ErrorKind, IteratorMode};
//#[cfg(debug_assertions)]
macro_rules! unhandled {
@ -45,6 +45,9 @@ pub(crate) fn and_then<T>(t: T) -> Result<T, conduit::Error> { Ok(t) }
pub(crate) fn or_else<T>(e: rocksdb::Error) -> Result<T, conduit::Error> { Err(map_err(e)) }
#[inline]
pub(crate) fn is_incomplete(e: &rocksdb::Error) -> bool { e.kind() == ErrorKind::Incomplete }
pub(crate) fn map_err(e: rocksdb::Error) -> conduit::Error {
let string = e.into_string();
err!(Database(error!("{string}")))