예제 #1
0
        //////////////////////////////////////////////////////////////////////////////////////////////

        private void StartWorker()
        {
            Logger.Log.Info("Starting Evolution mail backend");

            Stopwatch stopwatch = new Stopwatch();

            stopwatch.Start();

            // Check that we have data to index
            if ((!Directory.Exists(this.local_path)) && (!Directory.Exists(this.imap_path)))
            {
                // No mails present, repoll every minute
                Logger.Log.Warn("Evolution mail store not found, watching for it.");
                GLib.Timeout.Add(60000, new GLib.TimeoutHandler(CheckForMailData));
                return;
            }

            Logger.Log.Debug("Starting mail crawl");
            crawler = new MailCrawler(this.local_path, this.imap_path, this.imap4_path);
            crawler.MboxAddedEvent    += IndexMbox;
            crawler.SummaryAddedEvent += IndexSummary;
            crawler.Crawl();
            Logger.Log.Debug("Mail crawl finished");

            // If we don't have inotify, we have to poll the file system.  Ugh.
            if (!Inotify.Enabled)
            {
                Scheduler.Task task = Scheduler.TaskFromHook(new Scheduler.TaskHook(CrawlHook));
                task.Tag    = "Crawling ~/.evolution to find summary changes";
                task.Source = this;
                ThisScheduler.Add(task);
            }

            stopwatch.Stop();
            Logger.Log.Info("Evolution mail driver worker thread done in {0}",
                            stopwatch);
        }
		//////////////////////////////////////////////////////////////////////////////////////////////

		private void StartWorker ()
		{
			Logger.Log.Info ("Starting Evolution mail backend");

			Stopwatch stopwatch = new Stopwatch ();
			stopwatch.Start ();

			// Check that we have data to index
			if ((! Directory.Exists (this.local_path)) && (! Directory.Exists (this.imap_path))) {
				// No mails present, repoll every minute
				Logger.Log.Warn ("Evolution mail store not found, watching for it.");
				GLib.Timeout.Add (60000, new GLib.TimeoutHandler (CheckForMailData));
				return;
			}

			Logger.Log.Debug ("Starting mail crawl");
			crawler = new MailCrawler (this.local_path, this.imap_path, this.imap4_path);
			crawler.MboxAddedEvent += IndexMbox;
			crawler.SummaryAddedEvent += IndexSummary;
			crawler.Crawl ();
			Logger.Log.Debug ("Mail crawl finished");

			// If we don't have inotify, we have to poll the file system.  Ugh.
			if (! Inotify.Enabled) {
				Scheduler.Task task = Scheduler.TaskFromHook (new Scheduler.TaskHook (CrawlHook));
				task.Tag = "Crawling ~/.evolution to find summary changes";
				task.Source = this;
				ThisScheduler.Add (task);
			}

			stopwatch.Stop ();
			Logger.Log.Info ("Evolution mail driver worker thread done in {0}",
					 stopwatch);
		}
예제 #3
0
 private void CrawlHook(Scheduler.Task task)
 {
     crawler.Crawl();
     task.Reschedule  = true;
     task.TriggerTime = DateTime.Now.AddSeconds(polling_interval_in_seconds);
 }