Esempio n. 1
0
 public void Run()
 {
     if (_working)
     {
         _log.LogWarning("Skipping catalog invalidation because previous run has not completed yet");
         return;
     }
     _working = true;
     try
     {
         DateTimeOffset start = store.LastScanEndDate;
         DateTimeOffset end   = DateTimeOffset.UtcNow;
         _log.LogInformation("Getting all upstream changes between {0} and {1}", start, end);
         var  changes   = reader.GetFlattenedEntries(start, end);
         bool anyFailed = false;
         foreach (var h in this.UpdatedEntry.GetInvocationList())
         {
             try
             {
                 var del = (EventHandler <CatalogEntryEventArgs>)h;
                 del(this, new CatalogEntryEventArgs(changes));
             }
             catch (Exception ex)
             {
                 anyFailed = true;
                 _log.LogError("Failed to execute catalog entry handler", ex);
             }
         }
         if (!anyFailed)
         {
             store.LastScanEndDate = end;
         }
         _log.LogInformation("Finished handling {0} upstream changes", changes.Count);
     }
     catch (Exception ex)
     {
         _log.LogError("Catalog scan failed", ex);
     }
     finally
     {
         _working = false;
     }
 }
Esempio n. 2
0
 public void Warn(string message, params object[] args)
 {
     _logger.LogWarning(message, args);
 }
Esempio n. 3
0
 public void LogWarning(string message, params object[] p)
 {
     _logger.LogWarning(message, p);
 }
 public void Warn(object message, Exception exception = null)
 {
     _logger.LogWarning(message.ToString());
 }