mirror of
https://git.asonix.dog/asonix/pict-rs
synced 2024-11-20 11:21:14 +00:00
Instrument repo and store build methods
This commit is contained in:
parent
d51c348a3f
commit
4680f9c3aa
5 changed files with 7 additions and 4 deletions
|
@ -461,6 +461,7 @@ where
|
|||
}
|
||||
|
||||
impl Repo {
|
||||
#[tracing::instrument]
|
||||
pub(crate) fn open(config: config::Repo) -> color_eyre::Result<Self> {
|
||||
match config {
|
||||
config::Repo::Sled(config::Sled {
|
||||
|
|
|
@ -44,6 +44,7 @@ pub(super) struct Old {
|
|||
}
|
||||
|
||||
impl Old {
|
||||
#[tracing::instrument]
|
||||
pub(super) fn open(path: PathBuf) -> color_eyre::Result<Option<Self>> {
|
||||
if let Some(db) = migrate::LatestDb::exists(path).migrate()? {
|
||||
Ok(Some(Self {
|
||||
|
|
|
@ -71,6 +71,7 @@ pub(crate) struct SledRepo {
|
|||
}
|
||||
|
||||
impl SledRepo {
|
||||
#[tracing::instrument(skip(db))]
|
||||
pub(crate) fn new(db: Db) -> Result<Self, SledError> {
|
||||
Ok(SledRepo {
|
||||
healthz_count: Arc::new(AtomicU64::new(0)),
|
||||
|
|
|
@ -162,12 +162,11 @@ impl Store for FileStore {
|
|||
}
|
||||
|
||||
impl FileStore {
|
||||
pub(crate) async fn build(root_dir: PathBuf, repo: Repo) -> Result<Self, StoreError> {
|
||||
#[tracing::instrument(skip(repo))]
|
||||
pub(crate) async fn build(root_dir: PathBuf, repo: Repo) -> color_eyre::Result<Self> {
|
||||
let path_gen = init_generator(&repo).await?;
|
||||
|
||||
tokio::fs::create_dir_all(&root_dir)
|
||||
.await
|
||||
.map_err(FileError::from)?;
|
||||
tokio::fs::create_dir_all(&root_dir).await?;
|
||||
|
||||
Ok(FileStore {
|
||||
root_dir,
|
||||
|
|
|
@ -428,6 +428,7 @@ impl Store for ObjectStore {
|
|||
|
||||
impl ObjectStore {
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
#[tracing::instrument(skip(access_key, secret_key, session_token, repo))]
|
||||
pub(crate) async fn build(
|
||||
endpoint: Url,
|
||||
bucket_name: String,
|
||||
|
|
Loading…
Reference in a new issue