mirror of
https://git.asonix.dog/asonix/pict-rs
synced 2024-11-10 06:25:00 +00:00
Clean spans a bit
This commit is contained in:
parent
903b2b0d56
commit
bd0b89b165
10 changed files with 63 additions and 59 deletions
|
@ -79,7 +79,7 @@ impl Details {
|
||||||
self.inner.created_at.timestamp
|
self.inner.created_at.timestamp
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(level = "DEBUG")]
|
#[tracing::instrument(level = "debug", skip_all)]
|
||||||
pub(crate) async fn from_bytes(
|
pub(crate) async fn from_bytes(
|
||||||
tmp_dir: &TmpDir,
|
tmp_dir: &TmpDir,
|
||||||
timeout: u64,
|
timeout: u64,
|
||||||
|
|
|
@ -26,6 +26,7 @@ pub(crate) enum DiscoverError {
|
||||||
UnsupportedFileType(String),
|
UnsupportedFileType(String),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[tracing::instrument(level = "trace", skip_all)]
|
||||||
pub(crate) async fn discover_bytes(
|
pub(crate) async fn discover_bytes(
|
||||||
tmp_dir: &TmpDir,
|
tmp_dir: &TmpDir,
|
||||||
timeout: u64,
|
timeout: u64,
|
||||||
|
|
|
@ -9,7 +9,7 @@ use crate::{
|
||||||
|
|
||||||
use super::Discovery;
|
use super::Discovery;
|
||||||
|
|
||||||
#[tracing::instrument(level = "DEBUG", skip_all)]
|
#[tracing::instrument(level = "debug", skip_all)]
|
||||||
pub(super) async fn check_reorient(
|
pub(super) async fn check_reorient(
|
||||||
Discovery {
|
Discovery {
|
||||||
input,
|
input,
|
||||||
|
@ -40,7 +40,7 @@ pub(super) async fn check_reorient(
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(level = "trace", skip(input))]
|
#[tracing::instrument(level = "trace", skip_all)]
|
||||||
async fn needs_reorienting(input: Bytes, timeout: u64) -> Result<bool, ExifError> {
|
async fn needs_reorienting(input: Bytes, timeout: u64) -> Result<bool, ExifError> {
|
||||||
let process = Process::run("exiftool", &["-n", "-Orientation", "-"], &[], timeout)?;
|
let process = Process::run("exiftool", &["-n", "-Orientation", "-"], &[], timeout)?;
|
||||||
let mut reader = process.bytes_read(input);
|
let mut reader = process.bytes_read(input);
|
||||||
|
|
|
@ -158,6 +158,7 @@ struct Flags {
|
||||||
alpha: usize,
|
alpha: usize,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[tracing::instrument(skip_all)]
|
||||||
pub(super) async fn discover_bytes(
|
pub(super) async fn discover_bytes(
|
||||||
tmp_dir: &TmpDir,
|
tmp_dir: &TmpDir,
|
||||||
timeout: u64,
|
timeout: u64,
|
||||||
|
@ -190,7 +191,7 @@ async fn allows_alpha(pixel_format: &str, timeout: u64) -> Result<bool, FfMpegEr
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(skip(f))]
|
#[tracing::instrument(level = "debug", skip_all)]
|
||||||
async fn discover_file<F, Fut>(
|
async fn discover_file<F, Fut>(
|
||||||
tmp_dir: &TmpDir,
|
tmp_dir: &TmpDir,
|
||||||
timeout: u64,
|
timeout: u64,
|
||||||
|
@ -259,6 +260,7 @@ where
|
||||||
Ok(Some(discovery))
|
Ok(Some(discovery))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[tracing::instrument(level = "debug", skip_all)]
|
||||||
async fn alpha_pixel_formats(timeout: u64) -> Result<HashSet<String>, FfMpegError> {
|
async fn alpha_pixel_formats(timeout: u64) -> Result<HashSet<String>, FfMpegError> {
|
||||||
let process = Process::run(
|
let process = Process::run(
|
||||||
"ffprobe",
|
"ffprobe",
|
||||||
|
|
|
@ -31,6 +31,7 @@ struct Geometry {
|
||||||
height: u16,
|
height: u16,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[tracing::instrument(skip_all)]
|
||||||
pub(super) async fn confirm_bytes(
|
pub(super) async fn confirm_bytes(
|
||||||
tmp_dir: &TmpDir,
|
tmp_dir: &TmpDir,
|
||||||
discovery: Option<Discovery>,
|
discovery: Option<Discovery>,
|
||||||
|
@ -93,7 +94,7 @@ pub(super) async fn confirm_bytes(
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(level = "DEBUG", skip(f))]
|
#[tracing::instrument(level = "debug", skip_all)]
|
||||||
async fn count_avif_frames<F, Fut>(tmp_dir: &TmpDir, timeout: u64, f: F) -> Result<u32, MagickError>
|
async fn count_avif_frames<F, Fut>(tmp_dir: &TmpDir, timeout: u64, f: F) -> Result<u32, MagickError>
|
||||||
where
|
where
|
||||||
F: FnOnce(crate::file::File) -> Fut,
|
F: FnOnce(crate::file::File) -> Fut,
|
||||||
|
@ -156,7 +157,7 @@ where
|
||||||
Ok(lines)
|
Ok(lines)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(level = "DEBUG", skip(f))]
|
#[tracing::instrument(level = "debug", skip_all)]
|
||||||
async fn discover_file<F, Fut>(
|
async fn discover_file<F, Fut>(
|
||||||
tmp_dir: &TmpDir,
|
tmp_dir: &TmpDir,
|
||||||
timeout: u64,
|
timeout: u64,
|
||||||
|
|
|
@ -45,7 +45,7 @@ impl ThumbnailFormat {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(skip(store))]
|
#[tracing::instrument(skip(tmp_dir, store, timeout))]
|
||||||
pub(super) async fn thumbnail<S: Store>(
|
pub(super) async fn thumbnail<S: Store>(
|
||||||
tmp_dir: &TmpDir,
|
tmp_dir: &TmpDir,
|
||||||
store: S,
|
store: S,
|
||||||
|
|
|
@ -243,7 +243,7 @@ impl Drop for GetConnectionMetricsGuard {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Inner {
|
impl Inner {
|
||||||
#[tracing::instrument(level = "TRACE", skip(self))]
|
#[tracing::instrument(level = "trace", skip(self))]
|
||||||
async fn get_connection(&self) -> Result<Object<AsyncPgConnection>, PostgresError> {
|
async fn get_connection(&self) -> Result<Object<AsyncPgConnection>, PostgresError> {
|
||||||
let guard = GetConnectionMetricsGuard::guard();
|
let guard = GetConnectionMetricsGuard::guard();
|
||||||
|
|
||||||
|
@ -446,7 +446,7 @@ impl BaseRepo for PostgresRepo {}
|
||||||
|
|
||||||
#[async_trait::async_trait(?Send)]
|
#[async_trait::async_trait(?Send)]
|
||||||
impl HashRepo for PostgresRepo {
|
impl HashRepo for PostgresRepo {
|
||||||
#[tracing::instrument(level = "DEBUG", skip(self))]
|
#[tracing::instrument(level = "debug", skip(self))]
|
||||||
async fn size(&self) -> Result<u64, RepoError> {
|
async fn size(&self) -> Result<u64, RepoError> {
|
||||||
use schema::hashes::dsl::*;
|
use schema::hashes::dsl::*;
|
||||||
|
|
||||||
|
@ -464,7 +464,7 @@ impl HashRepo for PostgresRepo {
|
||||||
Ok(count.try_into().expect("non-negative count"))
|
Ok(count.try_into().expect("non-negative count"))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(level = "DEBUG", skip(self))]
|
#[tracing::instrument(level = "debug", skip(self))]
|
||||||
async fn bound(&self, input_hash: Hash) -> Result<Option<OrderedHash>, RepoError> {
|
async fn bound(&self, input_hash: Hash) -> Result<Option<OrderedHash>, RepoError> {
|
||||||
use schema::hashes::dsl::*;
|
use schema::hashes::dsl::*;
|
||||||
|
|
||||||
|
@ -488,7 +488,7 @@ impl HashRepo for PostgresRepo {
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(level = "DEBUG", skip(self))]
|
#[tracing::instrument(level = "debug", skip(self))]
|
||||||
async fn hash_page_by_date(
|
async fn hash_page_by_date(
|
||||||
&self,
|
&self,
|
||||||
date: time::OffsetDateTime,
|
date: time::OffsetDateTime,
|
||||||
|
@ -519,7 +519,7 @@ impl HashRepo for PostgresRepo {
|
||||||
self.hashes_ordered(ordered_hash, limit).await
|
self.hashes_ordered(ordered_hash, limit).await
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(level = "DEBUG", skip(self))]
|
#[tracing::instrument(level = "debug", skip(self))]
|
||||||
async fn hashes_ordered(
|
async fn hashes_ordered(
|
||||||
&self,
|
&self,
|
||||||
bound: Option<OrderedHash>,
|
bound: Option<OrderedHash>,
|
||||||
|
@ -592,7 +592,7 @@ impl HashRepo for PostgresRepo {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(level = "DEBUG", skip(self))]
|
#[tracing::instrument(level = "debug", skip(self))]
|
||||||
async fn create_hash_with_timestamp(
|
async fn create_hash_with_timestamp(
|
||||||
&self,
|
&self,
|
||||||
input_hash: Hash,
|
input_hash: Hash,
|
||||||
|
@ -627,7 +627,7 @@ impl HashRepo for PostgresRepo {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(level = "DEBUG", skip(self))]
|
#[tracing::instrument(level = "debug", skip(self))]
|
||||||
async fn update_identifier(
|
async fn update_identifier(
|
||||||
&self,
|
&self,
|
||||||
input_hash: Hash,
|
input_hash: Hash,
|
||||||
|
@ -650,7 +650,7 @@ impl HashRepo for PostgresRepo {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(level = "DEBUG", skip(self))]
|
#[tracing::instrument(level = "debug", skip(self))]
|
||||||
async fn identifier(&self, input_hash: Hash) -> Result<Option<Arc<str>>, RepoError> {
|
async fn identifier(&self, input_hash: Hash) -> Result<Option<Arc<str>>, RepoError> {
|
||||||
use schema::hashes::dsl::*;
|
use schema::hashes::dsl::*;
|
||||||
|
|
||||||
|
@ -670,7 +670,7 @@ impl HashRepo for PostgresRepo {
|
||||||
Ok(opt.map(Arc::from))
|
Ok(opt.map(Arc::from))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(level = "DEBUG", skip(self))]
|
#[tracing::instrument(level = "debug", skip(self))]
|
||||||
async fn relate_variant_identifier(
|
async fn relate_variant_identifier(
|
||||||
&self,
|
&self,
|
||||||
input_hash: Hash,
|
input_hash: Hash,
|
||||||
|
@ -703,7 +703,7 @@ impl HashRepo for PostgresRepo {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(level = "DEBUG", skip(self))]
|
#[tracing::instrument(level = "debug", skip(self))]
|
||||||
async fn variant_identifier(
|
async fn variant_identifier(
|
||||||
&self,
|
&self,
|
||||||
input_hash: Hash,
|
input_hash: Hash,
|
||||||
|
@ -729,7 +729,7 @@ impl HashRepo for PostgresRepo {
|
||||||
Ok(opt)
|
Ok(opt)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(level = "DEBUG", skip(self))]
|
#[tracing::instrument(level = "debug", skip(self))]
|
||||||
async fn variants(&self, input_hash: Hash) -> Result<Vec<(String, Arc<str>)>, RepoError> {
|
async fn variants(&self, input_hash: Hash) -> Result<Vec<(String, Arc<str>)>, RepoError> {
|
||||||
use schema::variants::dsl::*;
|
use schema::variants::dsl::*;
|
||||||
|
|
||||||
|
@ -751,7 +751,7 @@ impl HashRepo for PostgresRepo {
|
||||||
Ok(vec)
|
Ok(vec)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(level = "DEBUG", skip(self))]
|
#[tracing::instrument(level = "debug", skip(self))]
|
||||||
async fn remove_variant(
|
async fn remove_variant(
|
||||||
&self,
|
&self,
|
||||||
input_hash: Hash,
|
input_hash: Hash,
|
||||||
|
@ -774,7 +774,7 @@ impl HashRepo for PostgresRepo {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(level = "DEBUG", skip(self))]
|
#[tracing::instrument(level = "debug", skip(self))]
|
||||||
async fn relate_motion_identifier(
|
async fn relate_motion_identifier(
|
||||||
&self,
|
&self,
|
||||||
input_hash: Hash,
|
input_hash: Hash,
|
||||||
|
@ -797,7 +797,7 @@ impl HashRepo for PostgresRepo {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(level = "DEBUG", skip(self))]
|
#[tracing::instrument(level = "debug", skip(self))]
|
||||||
async fn motion_identifier(&self, input_hash: Hash) -> Result<Option<Arc<str>>, RepoError> {
|
async fn motion_identifier(&self, input_hash: Hash) -> Result<Option<Arc<str>>, RepoError> {
|
||||||
use schema::hashes::dsl::*;
|
use schema::hashes::dsl::*;
|
||||||
|
|
||||||
|
@ -819,7 +819,7 @@ impl HashRepo for PostgresRepo {
|
||||||
Ok(opt)
|
Ok(opt)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(level = "DEBUG", skip(self))]
|
#[tracing::instrument(level = "debug", skip(self))]
|
||||||
async fn cleanup_hash(&self, input_hash: Hash) -> Result<(), RepoError> {
|
async fn cleanup_hash(&self, input_hash: Hash) -> Result<(), RepoError> {
|
||||||
let mut conn = self.get_connection().await?;
|
let mut conn = self.get_connection().await?;
|
||||||
|
|
||||||
|
@ -847,7 +847,7 @@ impl HashRepo for PostgresRepo {
|
||||||
|
|
||||||
#[async_trait::async_trait(?Send)]
|
#[async_trait::async_trait(?Send)]
|
||||||
impl AliasRepo for PostgresRepo {
|
impl AliasRepo for PostgresRepo {
|
||||||
#[tracing::instrument(level = "DEBUG", skip(self))]
|
#[tracing::instrument(level = "debug", skip(self))]
|
||||||
async fn create_alias(
|
async fn create_alias(
|
||||||
&self,
|
&self,
|
||||||
input_alias: &Alias,
|
input_alias: &Alias,
|
||||||
|
@ -880,7 +880,7 @@ impl AliasRepo for PostgresRepo {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(level = "DEBUG", skip(self))]
|
#[tracing::instrument(level = "debug", skip(self))]
|
||||||
async fn delete_token(&self, input_alias: &Alias) -> Result<Option<DeleteToken>, RepoError> {
|
async fn delete_token(&self, input_alias: &Alias) -> Result<Option<DeleteToken>, RepoError> {
|
||||||
use schema::aliases::dsl::*;
|
use schema::aliases::dsl::*;
|
||||||
|
|
||||||
|
@ -900,7 +900,7 @@ impl AliasRepo for PostgresRepo {
|
||||||
Ok(opt)
|
Ok(opt)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(level = "DEBUG", skip(self))]
|
#[tracing::instrument(level = "debug", skip(self))]
|
||||||
async fn hash(&self, input_alias: &Alias) -> Result<Option<Hash>, RepoError> {
|
async fn hash(&self, input_alias: &Alias) -> Result<Option<Hash>, RepoError> {
|
||||||
use schema::aliases::dsl::*;
|
use schema::aliases::dsl::*;
|
||||||
|
|
||||||
|
@ -920,7 +920,7 @@ impl AliasRepo for PostgresRepo {
|
||||||
Ok(opt)
|
Ok(opt)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(level = "DEBUG", skip(self))]
|
#[tracing::instrument(level = "debug", skip(self))]
|
||||||
async fn aliases_for_hash(&self, input_hash: Hash) -> Result<Vec<Alias>, RepoError> {
|
async fn aliases_for_hash(&self, input_hash: Hash) -> Result<Vec<Alias>, RepoError> {
|
||||||
use schema::aliases::dsl::*;
|
use schema::aliases::dsl::*;
|
||||||
|
|
||||||
|
@ -939,7 +939,7 @@ impl AliasRepo for PostgresRepo {
|
||||||
Ok(vec)
|
Ok(vec)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(level = "DEBUG", skip(self))]
|
#[tracing::instrument(level = "debug", skip(self))]
|
||||||
async fn cleanup_alias(&self, input_alias: &Alias) -> Result<(), RepoError> {
|
async fn cleanup_alias(&self, input_alias: &Alias) -> Result<(), RepoError> {
|
||||||
use schema::aliases::dsl::*;
|
use schema::aliases::dsl::*;
|
||||||
|
|
||||||
|
@ -960,7 +960,7 @@ impl AliasRepo for PostgresRepo {
|
||||||
|
|
||||||
#[async_trait::async_trait(?Send)]
|
#[async_trait::async_trait(?Send)]
|
||||||
impl SettingsRepo for PostgresRepo {
|
impl SettingsRepo for PostgresRepo {
|
||||||
#[tracing::instrument(level = "DEBUG", skip(self, input_value))]
|
#[tracing::instrument(level = "debug", skip(self, input_value))]
|
||||||
async fn set(&self, input_key: &'static str, input_value: Arc<[u8]>) -> Result<(), RepoError> {
|
async fn set(&self, input_key: &'static str, input_value: Arc<[u8]>) -> Result<(), RepoError> {
|
||||||
use schema::settings::dsl::*;
|
use schema::settings::dsl::*;
|
||||||
|
|
||||||
|
@ -983,7 +983,7 @@ impl SettingsRepo for PostgresRepo {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(level = "DEBUG", skip(self))]
|
#[tracing::instrument(level = "debug", skip(self))]
|
||||||
async fn get(&self, input_key: &'static str) -> Result<Option<Arc<[u8]>>, RepoError> {
|
async fn get(&self, input_key: &'static str) -> Result<Option<Arc<[u8]>>, RepoError> {
|
||||||
use schema::settings::dsl::*;
|
use schema::settings::dsl::*;
|
||||||
|
|
||||||
|
@ -1007,7 +1007,7 @@ impl SettingsRepo for PostgresRepo {
|
||||||
Ok(opt)
|
Ok(opt)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(level = "DEBUG", skip(self))]
|
#[tracing::instrument(level = "debug", skip(self))]
|
||||||
async fn remove(&self, input_key: &'static str) -> Result<(), RepoError> {
|
async fn remove(&self, input_key: &'static str) -> Result<(), RepoError> {
|
||||||
use schema::settings::dsl::*;
|
use schema::settings::dsl::*;
|
||||||
|
|
||||||
|
@ -1028,7 +1028,7 @@ impl SettingsRepo for PostgresRepo {
|
||||||
|
|
||||||
#[async_trait::async_trait(?Send)]
|
#[async_trait::async_trait(?Send)]
|
||||||
impl DetailsRepo for PostgresRepo {
|
impl DetailsRepo for PostgresRepo {
|
||||||
#[tracing::instrument(level = "DEBUG", skip(self, input_details))]
|
#[tracing::instrument(level = "debug", skip(self, input_details))]
|
||||||
async fn relate_details(
|
async fn relate_details(
|
||||||
&self,
|
&self,
|
||||||
input_identifier: &Arc<str>,
|
input_identifier: &Arc<str>,
|
||||||
|
@ -1053,7 +1053,7 @@ impl DetailsRepo for PostgresRepo {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(level = "DEBUG", skip(self))]
|
#[tracing::instrument(level = "debug", skip(self))]
|
||||||
async fn details(&self, input_identifier: &Arc<str>) -> Result<Option<Details>, RepoError> {
|
async fn details(&self, input_identifier: &Arc<str>) -> Result<Option<Details>, RepoError> {
|
||||||
use schema::details::dsl::*;
|
use schema::details::dsl::*;
|
||||||
|
|
||||||
|
@ -1077,7 +1077,7 @@ impl DetailsRepo for PostgresRepo {
|
||||||
Ok(opt)
|
Ok(opt)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(level = "DEBUG", skip(self))]
|
#[tracing::instrument(level = "debug", skip(self))]
|
||||||
async fn cleanup_details(&self, input_identifier: &Arc<str>) -> Result<(), RepoError> {
|
async fn cleanup_details(&self, input_identifier: &Arc<str>) -> Result<(), RepoError> {
|
||||||
use schema::details::dsl::*;
|
use schema::details::dsl::*;
|
||||||
|
|
||||||
|
@ -1098,7 +1098,7 @@ impl DetailsRepo for PostgresRepo {
|
||||||
|
|
||||||
#[async_trait::async_trait(?Send)]
|
#[async_trait::async_trait(?Send)]
|
||||||
impl QueueRepo for PostgresRepo {
|
impl QueueRepo for PostgresRepo {
|
||||||
#[tracing::instrument(level = "DEBUG", skip(self, job_json))]
|
#[tracing::instrument(level = "debug", skip(self, job_json))]
|
||||||
async fn push(
|
async fn push(
|
||||||
&self,
|
&self,
|
||||||
queue_name: &'static str,
|
queue_name: &'static str,
|
||||||
|
@ -1125,7 +1125,7 @@ impl QueueRepo for PostgresRepo {
|
||||||
Ok(JobId(job_id))
|
Ok(JobId(job_id))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(level = "DEBUG", skip(self))]
|
#[tracing::instrument(level = "debug", skip(self))]
|
||||||
async fn pop(
|
async fn pop(
|
||||||
&self,
|
&self,
|
||||||
queue_name: &'static str,
|
queue_name: &'static str,
|
||||||
|
@ -1223,7 +1223,7 @@ impl QueueRepo for PostgresRepo {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(level = "DEBUG", skip(self))]
|
#[tracing::instrument(level = "debug", skip(self))]
|
||||||
async fn heartbeat(
|
async fn heartbeat(
|
||||||
&self,
|
&self,
|
||||||
queue_name: &'static str,
|
queue_name: &'static str,
|
||||||
|
@ -1253,7 +1253,7 @@ impl QueueRepo for PostgresRepo {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(level = "DEBUG", skip(self))]
|
#[tracing::instrument(level = "debug", skip(self))]
|
||||||
async fn complete_job(
|
async fn complete_job(
|
||||||
&self,
|
&self,
|
||||||
queue_name: &'static str,
|
queue_name: &'static str,
|
||||||
|
@ -1283,7 +1283,7 @@ impl QueueRepo for PostgresRepo {
|
||||||
|
|
||||||
#[async_trait::async_trait(?Send)]
|
#[async_trait::async_trait(?Send)]
|
||||||
impl StoreMigrationRepo for PostgresRepo {
|
impl StoreMigrationRepo for PostgresRepo {
|
||||||
#[tracing::instrument(level = "DEBUG", skip(self))]
|
#[tracing::instrument(level = "debug", skip(self))]
|
||||||
async fn is_continuing_migration(&self) -> Result<bool, RepoError> {
|
async fn is_continuing_migration(&self) -> Result<bool, RepoError> {
|
||||||
use schema::store_migrations::dsl::*;
|
use schema::store_migrations::dsl::*;
|
||||||
|
|
||||||
|
@ -1301,7 +1301,7 @@ impl StoreMigrationRepo for PostgresRepo {
|
||||||
Ok(count > 0)
|
Ok(count > 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(level = "DEBUG", skip(self))]
|
#[tracing::instrument(level = "debug", skip(self))]
|
||||||
async fn mark_migrated(
|
async fn mark_migrated(
|
||||||
&self,
|
&self,
|
||||||
input_old_identifier: &Arc<str>,
|
input_old_identifier: &Arc<str>,
|
||||||
|
@ -1328,7 +1328,7 @@ impl StoreMigrationRepo for PostgresRepo {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(level = "DEBUG", skip(self))]
|
#[tracing::instrument(level = "debug", skip(self))]
|
||||||
async fn is_migrated(&self, input_old_identifier: &Arc<str>) -> Result<bool, RepoError> {
|
async fn is_migrated(&self, input_old_identifier: &Arc<str>) -> Result<bool, RepoError> {
|
||||||
use schema::store_migrations::dsl::*;
|
use schema::store_migrations::dsl::*;
|
||||||
|
|
||||||
|
@ -1347,7 +1347,7 @@ impl StoreMigrationRepo for PostgresRepo {
|
||||||
Ok(b)
|
Ok(b)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(level = "DEBUG", skip(self))]
|
#[tracing::instrument(level = "debug", skip(self))]
|
||||||
async fn clear(&self) -> Result<(), RepoError> {
|
async fn clear(&self) -> Result<(), RepoError> {
|
||||||
use schema::store_migrations::dsl::*;
|
use schema::store_migrations::dsl::*;
|
||||||
|
|
||||||
|
@ -1367,7 +1367,7 @@ impl StoreMigrationRepo for PostgresRepo {
|
||||||
|
|
||||||
#[async_trait::async_trait(?Send)]
|
#[async_trait::async_trait(?Send)]
|
||||||
impl ProxyRepo for PostgresRepo {
|
impl ProxyRepo for PostgresRepo {
|
||||||
#[tracing::instrument(level = "DEBUG", skip(self))]
|
#[tracing::instrument(level = "debug", skip(self))]
|
||||||
async fn relate_url(&self, input_url: Url, input_alias: Alias) -> Result<(), RepoError> {
|
async fn relate_url(&self, input_url: Url, input_alias: Alias) -> Result<(), RepoError> {
|
||||||
use schema::proxies::dsl::*;
|
use schema::proxies::dsl::*;
|
||||||
|
|
||||||
|
@ -1385,7 +1385,7 @@ impl ProxyRepo for PostgresRepo {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(level = "DEBUG", skip(self))]
|
#[tracing::instrument(level = "debug", skip(self))]
|
||||||
async fn related(&self, input_url: Url) -> Result<Option<Alias>, RepoError> {
|
async fn related(&self, input_url: Url) -> Result<Option<Alias>, RepoError> {
|
||||||
use schema::proxies::dsl::*;
|
use schema::proxies::dsl::*;
|
||||||
|
|
||||||
|
@ -1405,7 +1405,7 @@ impl ProxyRepo for PostgresRepo {
|
||||||
Ok(opt)
|
Ok(opt)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(level = "DEBUG", skip(self))]
|
#[tracing::instrument(level = "debug", skip(self))]
|
||||||
async fn remove_relation(&self, input_alias: Alias) -> Result<(), RepoError> {
|
async fn remove_relation(&self, input_alias: Alias) -> Result<(), RepoError> {
|
||||||
use schema::proxies::dsl::*;
|
use schema::proxies::dsl::*;
|
||||||
|
|
||||||
|
@ -1426,7 +1426,7 @@ impl ProxyRepo for PostgresRepo {
|
||||||
|
|
||||||
#[async_trait::async_trait(?Send)]
|
#[async_trait::async_trait(?Send)]
|
||||||
impl AliasAccessRepo for PostgresRepo {
|
impl AliasAccessRepo for PostgresRepo {
|
||||||
#[tracing::instrument(level = "DEBUG", skip(self))]
|
#[tracing::instrument(level = "debug", skip(self))]
|
||||||
async fn set_accessed_alias(
|
async fn set_accessed_alias(
|
||||||
&self,
|
&self,
|
||||||
input_alias: Alias,
|
input_alias: Alias,
|
||||||
|
@ -1451,7 +1451,7 @@ impl AliasAccessRepo for PostgresRepo {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(level = "DEBUG", skip(self))]
|
#[tracing::instrument(level = "debug", skip(self))]
|
||||||
async fn alias_accessed_at(
|
async fn alias_accessed_at(
|
||||||
&self,
|
&self,
|
||||||
input_alias: Alias,
|
input_alias: Alias,
|
||||||
|
@ -1475,7 +1475,7 @@ impl AliasAccessRepo for PostgresRepo {
|
||||||
Ok(opt)
|
Ok(opt)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(level = "DEBUG", skip(self))]
|
#[tracing::instrument(level = "debug", skip(self))]
|
||||||
async fn older_aliases(
|
async fn older_aliases(
|
||||||
&self,
|
&self,
|
||||||
timestamp: time::OffsetDateTime,
|
timestamp: time::OffsetDateTime,
|
||||||
|
@ -1513,7 +1513,7 @@ impl AliasAccessRepo for PostgresRepo {
|
||||||
|
|
||||||
#[async_trait::async_trait(?Send)]
|
#[async_trait::async_trait(?Send)]
|
||||||
impl VariantAccessRepo for PostgresRepo {
|
impl VariantAccessRepo for PostgresRepo {
|
||||||
#[tracing::instrument(level = "DEBUG", skip(self))]
|
#[tracing::instrument(level = "debug", skip(self))]
|
||||||
async fn set_accessed_variant(
|
async fn set_accessed_variant(
|
||||||
&self,
|
&self,
|
||||||
input_hash: Hash,
|
input_hash: Hash,
|
||||||
|
@ -1539,7 +1539,7 @@ impl VariantAccessRepo for PostgresRepo {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(level = "DEBUG", skip(self))]
|
#[tracing::instrument(level = "debug", skip(self))]
|
||||||
async fn variant_accessed_at(
|
async fn variant_accessed_at(
|
||||||
&self,
|
&self,
|
||||||
input_hash: Hash,
|
input_hash: Hash,
|
||||||
|
@ -1564,7 +1564,7 @@ impl VariantAccessRepo for PostgresRepo {
|
||||||
Ok(opt)
|
Ok(opt)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(level = "DEBUG", skip(self))]
|
#[tracing::instrument(level = "debug", skip(self))]
|
||||||
async fn older_variants(
|
async fn older_variants(
|
||||||
&self,
|
&self,
|
||||||
timestamp: time::OffsetDateTime,
|
timestamp: time::OffsetDateTime,
|
||||||
|
@ -1638,7 +1638,7 @@ impl From<InnerUploadResult> for UploadResult {
|
||||||
|
|
||||||
#[async_trait::async_trait(?Send)]
|
#[async_trait::async_trait(?Send)]
|
||||||
impl UploadRepo for PostgresRepo {
|
impl UploadRepo for PostgresRepo {
|
||||||
#[tracing::instrument(level = "DEBUG", skip(self))]
|
#[tracing::instrument(level = "debug", skip(self))]
|
||||||
async fn create_upload(&self) -> Result<UploadId, RepoError> {
|
async fn create_upload(&self) -> Result<UploadId, RepoError> {
|
||||||
use schema::uploads::dsl::*;
|
use schema::uploads::dsl::*;
|
||||||
|
|
||||||
|
@ -1657,7 +1657,7 @@ impl UploadRepo for PostgresRepo {
|
||||||
Ok(UploadId { id: uuid })
|
Ok(UploadId { id: uuid })
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(level = "DEBUG", skip(self))]
|
#[tracing::instrument(level = "debug", skip(self))]
|
||||||
async fn wait(&self, upload_id: UploadId) -> Result<UploadResult, RepoError> {
|
async fn wait(&self, upload_id: UploadId) -> Result<UploadResult, RepoError> {
|
||||||
let guard = WaitMetricsGuard::guard();
|
let guard = WaitMetricsGuard::guard();
|
||||||
use schema::uploads::dsl::*;
|
use schema::uploads::dsl::*;
|
||||||
|
@ -1714,7 +1714,7 @@ impl UploadRepo for PostgresRepo {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(level = "DEBUG", skip(self))]
|
#[tracing::instrument(level = "debug", skip(self))]
|
||||||
async fn claim(&self, upload_id: UploadId) -> Result<(), RepoError> {
|
async fn claim(&self, upload_id: UploadId) -> Result<(), RepoError> {
|
||||||
use schema::uploads::dsl::*;
|
use schema::uploads::dsl::*;
|
||||||
|
|
||||||
|
@ -1732,7 +1732,7 @@ impl UploadRepo for PostgresRepo {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(level = "DEBUG", skip(self))]
|
#[tracing::instrument(level = "debug", skip(self))]
|
||||||
async fn complete_upload(
|
async fn complete_upload(
|
||||||
&self,
|
&self,
|
||||||
upload_id: UploadId,
|
upload_id: UploadId,
|
||||||
|
@ -1762,7 +1762,7 @@ impl UploadRepo for PostgresRepo {
|
||||||
|
|
||||||
#[async_trait::async_trait(?Send)]
|
#[async_trait::async_trait(?Send)]
|
||||||
impl FullRepo for PostgresRepo {
|
impl FullRepo for PostgresRepo {
|
||||||
#[tracing::instrument(level = "DEBUG", skip(self))]
|
#[tracing::instrument(level = "debug", skip(self))]
|
||||||
async fn health_check(&self) -> Result<(), RepoError> {
|
async fn health_check(&self) -> Result<(), RepoError> {
|
||||||
let next = self.inner.health_count.fetch_add(1, Ordering::Relaxed);
|
let next = self.inner.health_count.fetch_add(1, Ordering::Relaxed);
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,7 @@ pub(crate) struct FileStore {
|
||||||
|
|
||||||
#[async_trait::async_trait(?Send)]
|
#[async_trait::async_trait(?Send)]
|
||||||
impl Store for FileStore {
|
impl Store for FileStore {
|
||||||
#[tracing::instrument(level = "DEBUG", skip(self))]
|
#[tracing::instrument(level = "debug", skip(self))]
|
||||||
async fn health_check(&self) -> Result<(), StoreError> {
|
async fn health_check(&self) -> Result<(), StoreError> {
|
||||||
tokio::fs::metadata(&self.root_dir)
|
tokio::fs::metadata(&self.root_dir)
|
||||||
.await
|
.await
|
||||||
|
@ -227,7 +227,7 @@ impl FileStore {
|
||||||
Ok(target_path.join(filename))
|
Ok(target_path.join(filename))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(level = "DEBUG", skip(self, path), fields(path = ?path.as_ref()))]
|
#[tracing::instrument(level = "debug", skip(self, path), fields(path = ?path.as_ref()))]
|
||||||
async fn safe_remove_file<P: AsRef<Path>>(&self, path: P) -> Result<(), FileError> {
|
async fn safe_remove_file<P: AsRef<Path>>(&self, path: P) -> Result<(), FileError> {
|
||||||
tokio::fs::remove_file(&path).await?;
|
tokio::fs::remove_file(&path).await?;
|
||||||
self.try_remove_parents(path.as_ref()).await;
|
self.try_remove_parents(path.as_ref()).await;
|
||||||
|
|
|
@ -121,7 +121,7 @@ pub(crate) async fn validate_bytes(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(skip(bytes, validations))]
|
#[tracing::instrument(skip(tmp_dir, bytes, validations))]
|
||||||
async fn process_image(
|
async fn process_image(
|
||||||
tmp_dir: &TmpDir,
|
tmp_dir: &TmpDir,
|
||||||
bytes: Bytes,
|
bytes: Bytes,
|
||||||
|
|
|
@ -2,7 +2,7 @@ use actix_web::web::Bytes;
|
||||||
|
|
||||||
use crate::{exiftool::ExifError, process::Process, read::BoxRead};
|
use crate::{exiftool::ExifError, process::Process, read::BoxRead};
|
||||||
|
|
||||||
#[tracing::instrument(level = "trace", skip(input))]
|
#[tracing::instrument(level = "trace", skip_all)]
|
||||||
pub(crate) fn clear_metadata_bytes_read(
|
pub(crate) fn clear_metadata_bytes_read(
|
||||||
input: Bytes,
|
input: Bytes,
|
||||||
timeout: u64,
|
timeout: u64,
|
||||||
|
|
Loading…
Reference in a new issue