feature/sort-by-tag-count #32

Merged
cameron merged 2 commits from feature/sort-by-tag-count into master 2025-05-17 17:47:03 +00:00
Showing only changes of commit 484eec8b39 - Show all commits

View File

@@ -184,8 +184,10 @@ async fn upload_image(
&full_path.to_str().unwrap().to_string(),
true,
) {
let context = opentelemetry::Context::new().with_remote_span_context(span.span_context().clone());
tracer.span_builder("file write")
let context =
opentelemetry::Context::new().with_remote_span_context(span.span_context().clone());
tracer
.span_builder("file write")
.start_with_context(&tracer, &context);
if !full_path.is_file() && is_image_or_video(&full_path) {
@@ -322,7 +324,10 @@ async fn get_video_part(
file.into_response(&request)
} else {
error!("Video part not found: {:?}", file_part);
span.set_status(Status::error(format!("Video part not found '{}'", file_part.to_str().unwrap())));
span.set_status(Status::error(format!(
"Video part not found '{}'",
file_part.to_str().unwrap()
)));
HttpResponse::NotFound().finish()
}
}
@@ -454,7 +459,8 @@ fn create_thumbnails() {
let mut video_span = tracer.start_with_context(
"generate_video_thumbnail",
&opentelemetry::Context::new().with_remote_span_context(span.span_context().clone()),
&opentelemetry::Context::new()
.with_remote_span_context(span.span_context().clone()),
);
video_span.set_attributes(vec![
KeyValue::new("type", "video"),
@@ -538,7 +544,6 @@ fn main() -> std::io::Result<()> {
if let Err(err) = dotenv::dotenv() {
println!("Error parsing .env {:?}", err);
}
// env_logger::init();
run_migrations(&mut connect()).expect("Failed to run migrations");
@@ -546,9 +551,17 @@ fn main() -> std::io::Result<()> {
let system = actix::System::new();
system.block_on(async {
// Just use basic logger when running a non-release build
#[cfg(debug_assertions)]
{
env_logger::init();
}
#[cfg(not(debug_assertions))]
{
otel::init_logs();
otel::init_tracing();
}
otel::init_logs();
otel::init_tracing();
create_thumbnails();
let app_data = Data::new(AppState::default());