-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: more informatif log message and simplify task join
- Loading branch information
1 parent
7d63919
commit 6be2be2
Showing
13 changed files
with
170 additions
and
158 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,18 @@ | ||
use tokio::try_join; | ||
|
||
use crate::db::{ | ||
self, | ||
repository::{many_to_many::ManyToManyRepository, Repository}, | ||
}; | ||
|
||
pub async fn clean_handler() -> anyhow::Result<()> { | ||
println!("Open db connection..."); | ||
let pool = db::Database::create_connection().await?; | ||
println!("Clean up invalid foreign key"); | ||
let many_to_many_repo = ManyToManyRepository::new(&pool); | ||
|
||
try_join!( | ||
tokio::try_join!( | ||
many_to_many_repo.drop_invalid_class_to_plan(), | ||
many_to_many_repo.drop_invalid_class_to_lecturer() | ||
)?; | ||
pool.close().await; | ||
println!("Closing databse connection"); | ||
println!("Done"); | ||
Ok(()) | ||
} |
Oops, something went wrong.