imTigger / laravel-job-status

Add ability to track Job progress, status and result dispatched to Queue.
MIT License
407 stars 60 forks source link

JobStatus gets created and updated on different DB connections #68

Open aksonnic opened 3 years ago

aksonnic commented 3 years ago

For consistency, create and update on same connection. Also, creates issues for testing when test is executing in a transaction.

aksonnic commented 3 years ago

offending line:

Trackable.php, L61: $status = $entityClass::query()->create($data);

tpetry commented 3 years ago

Take a look at issue #9, there is a specific reason different connections are used. If you are using transactions within your jobs, the progress feature would not work because of transaction isolation.