예제 #1
0
        public async Task DownloadFile(CancellationToken token)
        {
            if (PricesFile.IsValid() && !PricesFile.IsFile() && !CacheExists())
            {
                await Downloader.DownloadPrices(token);
            }

            IsDownloadPriceComplete.Signal();
        }
예제 #2
0
 public void DeleteCache()
 {
     try
     {
         lock (_syncPriceCacheFile)
             PricesFile.DeleteFile();
     }
     catch (Exception ex)
     {
         _log.Error(ex);
     }
 }
예제 #3
0
 public void LoadFile(bool ignoreCache = false)
 {
     if (!ignoreCache && CacheExists())
     {
         _priceCacheContent = loadCacheFile();
     }
     else
     {
         _priceContent = PricesFile.IsFile()
                                 ? PricesFile.ReadAllBytes()
                                 : null;
     }
 }