Job Scheduling with Yesod

277 views Asked by At

Following problem:

I have a Yesod web app that is connected to a Postgres database (everything is hosted on AWS Elastic Beanstalk).

My customer wants to define a schedule (day, hour, ...) for things to happen automatically (e.g. sending out a message). E.g.: "every wednesday message A will be sent at 02:00 PM, but does not get sent after 03:00 PM if the server was down in that period". The definition could be saved to a text file on S3 for example.

One lib I found was https://hackage.haskell.org/package/cron which could be used as a basis for my needs with a caveat: if the server is shut down in that particular minute in which a job would be triggered, the message would not be sent when the server is back.

I used DelayedJob (Ruby) in the past and there the scheduled jobs were stored in a database to circumvent this issue. But in Haskell I could only find solutions without database persistence.

Is there anything to look into for Haskell or do I have to build that on my own e.g. use something like http://jdabbs.com/resquing-yesod/ as a starting point)?

0

There are 0 answers