feat: add log for deleting task content (#741)

Signed-off-by: Gaius <gaius.qi@gmail.com>
This commit is contained in:
Gaius 2024-09-20 15:06:32 +08:00 committed by GitHub
parent bd35df8d42
commit d9f15bdbfe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 0 deletions

View File

@ -224,6 +224,7 @@ impl Content {
// delete_task deletes the task content.
#[instrument(skip_all)]
pub async fn delete_task(&self, task_id: &str) -> Result<()> {
info!("delete task content: {}", task_id);
let task_path = self.dir.join(task_id);
fs::remove_file(task_path.as_path()).await.map_err(|err| {
error!("remove {:?} failed: {}", task_path, err);
@ -428,6 +429,7 @@ impl Content {
// delete_task deletes the cache task content.
#[instrument(skip_all)]
pub async fn delete_cache_task(&self, cache_task_id: &str) -> Result<()> {
info!("delete cache task content: {}", cache_task_id);
let cache_task_path = self.dir.join(cache_task_id);
fs::remove_file(cache_task_path.as_path())
.await