pythonscheduled-tasksceleryrecurring-events

Schedule reminder for recurring event


I'm working with a web application that allows users to create events (one-off or recurring) on a calendar, and shortly before an event starts the system will notify its participants. I'm having trouble with designing the flow for such notification, particularly for recurring events.

Things to consider:

  1. The architecture of the web application made it so that there are many databases of the same structure, each keeps its own set of users and events. Thus any query against one database needs to be made against several thousand others.
  2. A recurring event may have excluded dates (similar to RRULE and EXDATE combination).

  3. Users can update event's time / recurring rule.

  4. The application is written in Python and already using Celery 3.1 with Redis broker. Solutions work with this setting would be nice, though anything will do. From what I have found, it is hard to add periodic task dynamically with Celery currently.

A solution I'm attempting:

Sample code for above solution:

Some downsides of the above are:

Is there a more sensible approach to this?

Related questions:


Solution

  • It's been a long time without any answer, and I forgot about this question. Anyway, at the time I went with the following solution. I outline it here in case someone is interested.

    Some pros and cons that I could think of: