CORE-5772: updated the job status synchronization code to work with the new database structure