Originally Posted by whpalmer4
Ken, out of curiosity, does OF update the styling, trigger notifications, etc. by scanning the entire database every minute, or do you build (and maintain) a schedule of upcoming changes?
We maintain a schedule of upcoming events, and schedule a timer to wake up and update the task status at the time of the first unprocessed event within the next few hours. If there isn't anything scheduled to happen in the next few hours, we schedule an event to check the schedule again later. And, of course, we update and rescan the schedule when task dates are edited.
When the timer fires, we scan through all the tasks and update their status. Any groups to which that task belongs (projects, contexts, folders) should update their status and counters as well, and finally any views displaying any of those tasks or groups should redraw with the new status.