Adding code to save info to get data from bucket
pr CI / Test Suite (pull_request) Successful in 4m12s
pr CI / Test Suite (pull_request) Successful in 4m12s
This commit is contained in:
+12
-19
@@ -213,28 +213,21 @@ pub mod endpoint {
|
||||
Ok(res) => {
|
||||
println!("Result: {res:?}");
|
||||
|
||||
println!("Downloading file");
|
||||
match lr.download(&file_path).await {
|
||||
Ok(res) => {
|
||||
if res.is_empty() {
|
||||
println!("This should not be empty");
|
||||
} else {
|
||||
println!("Size: {:?}", res.len());
|
||||
println!("Going to delete file");
|
||||
println!("Saving to db");
|
||||
|
||||
match lr.delete(&file_path).await {
|
||||
Ok(res) => {
|
||||
println!("Result: {res:?}");
|
||||
println!("Deleted");
|
||||
}
|
||||
Err(err) => {
|
||||
eprintln!("Error: {err:?}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
match repo::data::insert(
|
||||
&pool,
|
||||
&file_path,
|
||||
&lr.config.bucket,
|
||||
&lr.config.region,
|
||||
&queued_song,
|
||||
)
|
||||
.await
|
||||
{
|
||||
Ok(_id) => {}
|
||||
Err(err) => {
|
||||
eprintln!("Error: {err:?}");
|
||||
return (axum::http::StatusCode::INTERNAL_SERVER_ERROR, axum::Json(response));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user