Ejemplo n.º 1
0
        public DateTime GetStationLastFetchTime(IAbstractDataSource source, Station station)
        {
            Dictionary <string, DateTime> sourceTimes;

            if (!_lastFetchTimes.TryGetValue(station.Id, out sourceTimes))
            {
                sourceTimes = SourcesDatabase.LoadLastFetchTimes(station);
                if (sourceTimes.Count == 0)
                {
                    return(DateTime.MinValue);
                }
                else
                {
                    _lastFetchTimes[station.Id] = sourceTimes;
                }
            }
            return(sourceTimes[source.Id]);
        }
Ejemplo n.º 2
0
 internal void FlushFetchTimes(IEnumerable <Station> stations)
 {
     SourcesDatabase.SaveLastFetchTimes(AllDataSources, stations);
 }