jobqueue-common
jobqueue-common copied to clipboard
Queue jobs executed in CLI does not persist repository changes unless executed isolated
Behavior
I'm having a job with a execute()
method like this
$transfer = new Transfer(...);
$this->transferRepository->add($transfer);
return true;
The new transfer object is not persisted to the database table when the message is finished
Expected behavior
Similar to other CLI command, I expected the new $transfer
object to be persisted
Proposed change
Have a signal/slot that call the persistAll
on the persistenceManager once a messageFinished
signal is sent