* Util/Scheduler.cs: Don't allow tasks to be added without a source * beagled/IndexSynchronization.cs: Fake a source for scheduler tasks Index: Util/Scheduler.cs =================================================================== RCS file: /cvs/gnome/beagle/Util/Scheduler.cs,v retrieving revision 1.30 diff -u -B -p -r1.30 Scheduler.cs --- Util/Scheduler.cs 15 Sep 2005 16:05:18 -0000 1.30 +++ Util/Scheduler.cs 6 Oct 2005 15:51:44 -0000 @@ -547,7 +547,10 @@ namespace Beagle.Util { { if (task == null) return; - + + if (task.Source == null) + throw new Exception ("Attempting to add Task with no source!"); + Task old_task = null; lock (big_lock) { Index: beagled/IndexSynchronization.cs =================================================================== RCS file: /cvs/gnome/beagle/beagled/IndexSynchronization.cs,v retrieving revision 1.1 diff -u -B -p -r1.1 IndexSynchronization.cs --- beagled/IndexSynchronization.cs 13 Jul 2005 16:28:40 -0000 1.1 +++ beagled/IndexSynchronization.cs 6 Oct 2005 15:51:45 -0000 @@ -68,12 +68,14 @@ namespace Beagle.Daemon { task.Tag = "Synchronize Indexes"; task.Priority = Scheduler.Priority.Delayed; task.TriggerTime = DateTime.Now.AddMinutes (sync_interval_in_minutes); + task.Source = synchronization_lock; Scheduler.Global.Add (task); // Set up the shutdown synchronization task task = Scheduler.TaskFromHook (new Scheduler.TaskHook (ShutdownHook)); task.Tag = "Synchronize Indexes on Shutdown"; task.Priority = Scheduler.Priority.Shutdown; + task.Source = synchronization_lock; Scheduler.Global.Add (task); }