Skip to content
This repository has been archived by the owner on Apr 17, 2018. It is now read-only.

Commit

Permalink
Fix cron job and log messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Wesley Moore committed Oct 16, 2012
1 parent 490c2ad commit dc694ae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion config/crontab
@@ -1,4 +1,4 @@
# IF YOU STUMBLE UPON THIS FILE YOU MAY NOT HAVE NOTICED THAT IT IS SYMLINKED
# INTO THE APP REPO. MAKE SURE THAT IT GETS COMMITED IF YOU MAKE ANY CHANGES.
23 * * * * www-data /srv/www/lesswrong.com/current/scripts/sync_wiki_export.sh
*/30 * * * * www-data /usr/local/bin/paster run production.ini /srv/www/lesswrong.com/current/scripts/run_pending_jobs.py
*/30 * * * * www-data cd /srv/www/lesswrong.com/current/r2 && /usr/local/bin/paster run production.ini ../scripts/run_pending_jobs.py
6 changes: 3 additions & 3 deletions scripts/run_pending_jobs.py
Expand Up @@ -32,7 +32,7 @@ def process_job(self, job):

runner = globals().get('job_' + job.action)
if not runner:
print >>stderr, 'Unknown job action {0!r}'.format(job.action))
print >>stderr, 'Unknown job action {0!r}'.format(job.action)
return

# If we can't acquire the lock, the job has already been claimed,
Expand All @@ -46,7 +46,7 @@ def process_job(self, job):
runner(**data)
except Exception as ex:
print >>stderr, 'Exception while running job id {0} ({1}): {2}'.format(
job._id, job.action, ex))
job._id, job.action, ex)
else:
self.mark_as_completed(job)
finally:
Expand Down Expand Up @@ -80,4 +80,4 @@ def job_send_meetup_email_to_user(meetup_id, username):
try:
JobProcessor().run()
except Exception as ex:
print >>stderr, 'Critical failure processing job queue: {0}'.format(ex))
print >>stderr, 'Critical failure processing job queue: {0}'.format(ex)

0 comments on commit dc694ae

Please sign in to comment.