* NewsFetcher: Fix last updated time

This commit is contained in:
zzz
2008-11-02 21:37:28 +00:00
parent 16ec091209
commit f3c9343c79

View File

@ -221,9 +221,11 @@ public class NewsFetcher implements Runnable, EepGet.StatusListener {
_log.info("News fetched from " + url + " with " + (alreadyTransferred+bytesTransferred)); _log.info("News fetched from " + url + " with " + (alreadyTransferred+bytesTransferred));
File temp = new File(TEMP_NEWS_FILE); File temp = new File(TEMP_NEWS_FILE);
long now = _context.clock().now();
if (temp.exists()) { if (temp.exists()) {
boolean copied = FileUtil.copy(TEMP_NEWS_FILE, NEWS_FILE, true); boolean copied = FileUtil.copy(TEMP_NEWS_FILE, NEWS_FILE, true);
if (copied) { if (copied) {
_lastUpdated = now;
temp.delete(); temp.delete();
checkForUpdates(); checkForUpdates();
} else { } else {
@ -234,7 +236,7 @@ public class NewsFetcher implements Runnable, EepGet.StatusListener {
if (_log.shouldLog(Log.WARN)) if (_log.shouldLog(Log.WARN))
_log.warn("Transfer complete, but no file? - probably 304 Not Modified"); _log.warn("Transfer complete, but no file? - probably 304 Not Modified");
} }
_lastFetch = _context.clock().now(); _lastFetch = now;
} }
public void transferFailed(String url, long bytesTransferred, long bytesRemaining, int currentAttempt) { public void transferFailed(String url, long bytesTransferred, long bytesRemaining, int currentAttempt) {