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
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 inlast_heartbeat_at
, which means thatwith_lock
will result in:Fixes #350