Fixed: Correctly expire object if file is removed from cache.

--HG--
branch : develop
This commit is contained in:
Nimetu 2017-06-08 22:37:19 +03:00
parent f80c8e7d81
commit e0ab70ca82

View file

@ -325,7 +325,7 @@ namespace NLGUI
time(&currentTime); time(&currentTime);
CHttpCacheObject cache = CHttpCache::getInstance()->lookup(download.dest); CHttpCacheObject cache = CHttpCache::getInstance()->lookup(download.dest);
if (cache.Expires > currentTime) if (CFile::fileExists(download.dest) && cache.Expires > currentTime)
{ {
#ifdef LOG_DL #ifdef LOG_DL
nlwarning("Cache for (%s) is not expired (%s, expires:%d)", download.url.c_str(), download.dest.c_str(), cache.Expires - currentTime); nlwarning("Cache for (%s) is not expired (%s, expires:%d)", download.url.c_str(), download.dest.c_str(), cache.Expires - currentTime);