19 using System.Threading.Tasks;
21 using System.Collections.Generic;
30 private Dictionary<AuxiliaryDataKey, MapFileResolver> _cache;
43 if (dueTime > TimeSpan.FromMinutes(10))
46 return dueTime - TimeSpan.FromMinutes(10);
58 _cache =
new Dictionary<AuxiliaryDataKey, MapFileResolver>();
67 if (_dataProvider !=
null)
72 _dataProvider = dataProvider;
88 if (!_cache.TryGetValue(auxiliaryDataKey, out result))
90 _cache[auxiliaryDataKey] = result = GetMapFileResolver(auxiliaryDataKey);
104 _cache =
new Dictionary<AuxiliaryDataKey, MapFileResolver>();
111 var market = auxiliaryDataKey.
Market;
113 var todayNewYork = timestamp.Date;
114 var yesterdayNewYork = todayNewYork.AddDays(-1);
118 var date = yesterdayNewYork;
124 var stream = _dataProvider.
Fetch(zipFileName);
129 Log.
Trace(
"LocalZipMapFileProvider.Get({0}): Fetched map files for: {1} NY", market, date.ToShortDateString());
131 stream.DisposeSafely();
138 throw new InvalidOperationException($
"LocalZipMapFileProvider couldn't find any map files going all the way back to {date} for {market}");
141 date = date.AddDays(-1);