tricycle/lesswrong — pull request #52 by johnsoft (2012-10-05 03:20:14+00:00)
Title: Meetup emails

I have no idea what your production environment is like, so I'll leave the cron setup to you. Here's what the entry should be, best as I can tell:

*/30 * * * * python2.6 /usr/local/bin/paster run production.ini /srv/www/lesswrong.com/current/scripts/run_pending_jobs.py

I haven't written the one-time geolocation script yet, but I figured you might want a head start in reviewing this. I'll add the script to this branch once it's done.

A few notes:
- The e-mail job is delayed by an hour, in case changes are made to a meetup right after its creation.
- For e-mails to be sent, two passes of the cron script are needed. The first creates the child jobs to send emails, and the second actually sends the emails.
- If an exception occurs, it will be printed to stdout, and the job will be left in the queue, so the logs will get flooded if there's a perpetual failure. (Would you rather this be e-mailed like web exceptions are?)