rails / solid_queue

Database-backed Active Job backend
MIT License
1.95k stars 130 forks source link

Clear previous changes before locking process for heartbeat #351

Closed rosa closed 2 months ago

rosa commented 2 months ago

For example, in case of a previous heartbeat failed because of a DB issue (with SQLite depending on configuration, a BusyException is not rare) and we still have the unpersisted value in last_heartbeat_at, which means that with_lock will result in:

RuntimeError: Locking a record with unpersisted changes is not supported

Fixes #350