///////////////////////////////////////////////// private void StartWorker() { if (!Directory.Exists(log_dir)) { GLib.Timeout.Add(60000, new GLib.TimeoutHandler(CheckForExistence)); return; } Logger.Log.Info("Starting Empathy log backend"); Stopwatch stopwatch = new Stopwatch(); stopwatch.Start(); if (Inotify.Enabled) { Watch(log_dir); } crawler = new EmpathyCrawler(log_dir); Crawl(); if (!Inotify.Enabled) { Scheduler.Task task = Scheduler.TaskFromHook(new Scheduler.TaskHook(CrawlHook)); task.Tag = "Crawling ~/.gnome2/Empathy to find new logfiles"; task.Source = this; ThisScheduler.Add(task); } stopwatch.Stop(); Logger.Log.Info("Empathy log backend worker thread done in {0}", stopwatch); }
///////////////////////////////////////////////// private void StartWorker() { if (! Directory.Exists (log_dir)) { GLib.Timeout.Add (60000, new GLib.TimeoutHandler (CheckForExistence)); return; } Logger.Log.Info ("Starting Empathy log backend"); Stopwatch stopwatch = new Stopwatch (); stopwatch.Start (); if (Inotify.Enabled) Watch (log_dir); crawler = new EmpathyCrawler (log_dir); Crawl (); if (!Inotify.Enabled) { Scheduler.Task task = Scheduler.TaskFromHook (new Scheduler.TaskHook (CrawlHook)); task.Tag = "Crawling ~/.gnome2/Empathy to find new logfiles"; task.Source = this; ThisScheduler.Add (task); } stopwatch.Stop (); Logger.Log.Info ("Empathy log backend worker thread done in {0}", stopwatch); }
///////////////////////////////////////////////// private void Crawl() { crawler.Crawl(); foreach (FileInfo file in crawler.Logs) { IndexLog(file.FullName, Scheduler.Priority.Delayed); } if (Inotify.Enabled) { crawler = null; // Free crawler since we do not need it any more } }
///////////////////////////////////////////////// private void Crawl () { crawler.Crawl (); foreach (FileInfo file in crawler.Logs) IndexLog (file.FullName, Scheduler.Priority.Delayed); if (Inotify.Enabled) crawler = null; // Free crawler since we do not need it any more }