I’m running into a weird issue when trying to use DataMapper with a background job processing library. My current gem setup includes:
background_job 2.1.0.pre2
background_job_data_mapper 1.0.0.rc
I can set up the backend and add jobs to the queue just fine:
BackgroundJob::Worker.backend = :data_mapper
BackgroundJob::Worker.backend.auto_upgrade!
Jobs get stored in the database without any problems. But when I try to start a worker process using a rake task, it boots up okay but then crashes when trying to fetch jobs from the queue. The error message I get is:
rake aborted!
expected a time or date, got Mon Mar 15 14:22:33 -0500 2011
The stack trace shows the error is happening in the find_available method when it tries to do some time calculations. It looks like there’s a format mismatch between what DataMapper is returning and what the job processing system expects.
Has anyone run into this before? Is there a workaround or maybe a different approach to get DataMapper working with background job processing? I’m wondering if there’s a gem version compatibility issue or if I need to configure something differently.