jobqueue-common icon indicating copy to clipboard operation
jobqueue-common copied to clipboard

Queue jobs executed in CLI does not persist repository changes unless executed isolated

Open sorenmalling opened this issue 4 years ago • 10 comments

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

sorenmalling avatar Jan 28 '20 15:01 sorenmalling