Esempio n. 1
0
 /// <summary>
 ///     Is an update check needed?
 /// </summary>
 /// <returns>bool true if yes</returns>
 public static bool IsUpdateCheckNeeded()
 {
     lock (LockObject)
     {
         if (CoreConfig.UpdateCheckInterval == 0)
         {
             return(false);
         }
         var checkTime = CoreConfig.LastUpdateCheck;
         checkTime = checkTime.AddDays(CoreConfig.UpdateCheckInterval);
         if (DateTime.Now.CompareTo(checkTime) < 0)
         {
             Log.Debug().WriteLine("No need to check RSS feed for updates, feed check will be after {0}", checkTime);
             return(false);
         }
         Log.Debug().WriteLine("Update check is due, last check was {0} check needs to be made after {1} (which is one {2} later)", CoreConfig.LastUpdateCheck, checkTime,
                               CoreConfig.UpdateCheckInterval);
         if (!RssHelper.IsRssModifiedAfter(CoreConfig.LastUpdateCheck))
         {
             Log.Debug().WriteLine("RSS feed has not been updated since after {0}", CoreConfig.LastUpdateCheck);
             return(false);
         }
     }
     return(true);
 }