public string RebuildSearchIndexes(IContext context, long id) { var log = new SysLogModel(context: context); var json = SearchIndexUtilities.RebuildSearchIndexes( context: context, siteModel: new SiteModel( context: context, siteId: id)); log.Finish(context: context, responseSize: json.Length); return(json); }
public static string Do(Context context) { var now = DateTime.Now; while ((DateTime.Now - now).Seconds <= Parameters.BackgroundTask.BackgroundTaskSpan) { SysLogUtilities.Maintain(context: context); SearchIndexUtilities.Maintain(context: context); SearchIndexUtilities.RebuildSearchIndexes(context: context); Thread.Sleep(Parameters.BackgroundTask.Interval); LatestTime = DateTime.Now; } return(new ResponseCollection().ToJson()); }