Merge pull request #2224 from mfietz/issue/2160-feed-files-pile-up

Remove cached feed file after parsing
This commit is contained in:
Martin Fietz 2017-04-09 20:24:11 +02:00 committed by GitHub
commit 8864f51f03
1 changed files with 6 additions and 3 deletions

View File

@ -842,10 +842,13 @@ public class DownloadService extends Service {
successful = false;
reason = DownloadError.ERROR_PARSER_EXCEPTION;
reasonDetailed = e.getMessage();
} finally {
File feedFile = new File(request.getDestination());
if(feedFile.exists()) {
boolean deleted = feedFile.delete();
Log.d(TAG, "Deletion of file '" + feedFile.getAbsolutePath() + "' " + (deleted ? "successful" : "FAILED"));
}
}
// cleanup();
if (successful) {
// we create a 'successful' download log if the feed's last refresh failed