Exemplo n.º 1
0
 public void IndexNextTopic(IErrorLog errorLog, ISearchIndexSubsystem searchIndexSubsystem, ISearchService searchService, ITenantService tenantService)
 {
     if (!Monitor.TryEnter(_syncRoot, 5000))
     {
         return;
     }
     try
     {
         var topicID = searchService.GetNextTopicIDForIndexing().Result;
         if (topicID == 0)
         {
             return;
         }
         var tenantID = tenantService.GetTenant();
         searchIndexSubsystem.DoIndex(topicID, tenantID);
     }
     catch (Exception exc)
     {
         errorLog.Log(exc, ErrorSeverity.Error);
     }
     finally
     {
         Monitor.Exit(_syncRoot);
     }
 }
 public void IndexNextTopic(IErrorLog errorLog, ISearchIndexSubsystem searchIndexSubsystem, ISearchService searchService, ITenantService tenantService)
 {
     if (!Monitor.TryEnter(_syncRoot, 5000))
     {
         return;
     }
     try
     {
         var payload = searchService.GetNextTopicForIndexing().Result;
         if (payload == null)
         {
             return;
         }
         searchIndexSubsystem.DoIndex(payload.TopicID, payload.TenantID, payload.IsForRemoval);
     }
     catch (Exception exc)
     {
         errorLog.Log(exc, ErrorSeverity.Error);
     }
     finally
     {
         Monitor.Exit(_syncRoot);
     }
 }
Exemplo n.º 3
0
 public void IndexNextTopic(ISearchService searchService, ISettingsManager settingsManager, IPostService postService, IErrorLog errorLog, ISearchIndexSubsystem searchIndexSubsystem, IConfig config, ITopicService topicService)
 {
     if (!Monitor.TryEnter(_syncRoot))
     {
         return;
     }
     try
     {
         searchIndexSubsystem.DoIndex(searchService, settingsManager, postService, config, topicService, errorLog);
     }
     catch (Exception exc)
     {
         errorLog.Log(exc, ErrorSeverity.Error);
     }
     finally
     {
         Monitor.Exit(_syncRoot);
     }
 }