🐛 fix: Fixed the problem of incorrect file download status after restarting.
This commit is contained in:
parent
1f000348ae
commit
236bf0ac1f
1 changed files with 9 additions and 0 deletions
|
|
@ -424,6 +424,15 @@ public class TelegramVerticle extends AbstractVerticle {
|
||||||
return Future.failedFuture("File not started downloading");
|
return Future.failedFuture("File not started downloading");
|
||||||
}
|
}
|
||||||
if (isPaused && !file.local.isDownloadingActive) {
|
if (isPaused && !file.local.isDownloadingActive) {
|
||||||
|
if (file.local.isDownloadingCompleted) {
|
||||||
|
return DataVerticle.fileRepository.updateStatus(
|
||||||
|
file.id,
|
||||||
|
file.remote.uniqueId,
|
||||||
|
file.local.path,
|
||||||
|
FileRecord.DownloadStatus.completed,
|
||||||
|
System.currentTimeMillis()
|
||||||
|
).compose(r -> Future.failedFuture("File is already downloaded successfully"));
|
||||||
|
}
|
||||||
return Future.failedFuture("File is not downloading");
|
return Future.failedFuture("File is not downloading");
|
||||||
}
|
}
|
||||||
if (!isPaused && file.local.isDownloadingActive) {
|
if (!isPaused && file.local.isDownloadingActive) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue