Skip to content

Commit

Permalink
修复临时文件残留问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Chikage0o0 committed Oct 12, 2023
1 parent 72de16c commit d7f66a6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#### Docker
```bash
docker run -d --name matrix_bot \
-e HOME_SERVER_URL="https://xxx.xxx" \
-e HOMESERVER_URL="https://xxx.xxx" \
-e USERNAME="x" \
-e PASSWORD="x" \
-v ./matrix_bot:/matrix_bot \
Expand Down
4 changes: 4 additions & 0 deletions plugins/yande_popular/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ pub async fn run(client: Client, setting_folder: impl AsRef<Path>) -> Result<()>
room.send_attachment(&path)
.await
.unwrap_or_else(|e| log::error!("send attachment failed: {}", e));

std::fs::remove_file(&path).unwrap_or_else(|e| {
log::error!("remove file failed: {}", e);
});
}
}
log::info!("scan: {} done", setting.room_id);
Expand Down

0 comments on commit d7f66a6

Please sign in to comment.