make sure an UploadFinishedEvent always follows an UploadEvent, even if hashlist upload fails

auto-update
Zlatin Balevsky 2021-10-20 23:28:35 +01:00
parent 67f85cfa0b
commit 33287c781c
No known key found for this signature in database
GPG Key ID: A72832072D525E41
1 changed files with 5 additions and 2 deletions

View File

@ -209,8 +209,11 @@ public class UploadManager {
Uploader uploader = new HashListUploader(e, fullInfoHash, request)
eventBus.publish(new UploadEvent(uploader : uploader, first: true)) // hash list is always a first
try {
uploader.respond()
eventBus.publish(new UploadFinishedEvent(uploader : uploader))
try {
uploader.respond()
} finally {
eventBus.publish(new UploadFinishedEvent(uploader: uploader))
}
// proceed with content
boolean first = true