77use Flowpack \JobQueue \Common \Queue \Message ;
88use Flowpack \JobQueue \Common \Queue \QueueInterface ;
99use GuzzleHttp \Psr7 \Uri ;
10+ use InvalidArgumentException ;
1011use Neos \ContentRepository \Domain \Repository \WorkspaceRepository ;
1112use Neos \Flow \Annotations as Flow ;
1213use Neos \Flow \I18n \Translator ;
@@ -121,17 +122,15 @@ public function injectControllerContextFactory(ControllerContextFactory $control
121122
122123 public function execute (QueueInterface $ queue , Message $ message ): bool
123124 {
124- $ job = $ this ->jobRepository ->findByIdentifier ($ this ->jobIdentifier );
125- if (! $ job instanceof Job) {
126- throw new \ InvalidArgumentException ( sprintf ('No job with identifier "%s" found ' , $ this ->jobIdentifier ),
125+ if (! $ this ->jobRepository ->findByIdentifier ($ this ->jobIdentifier ) instanceof Job) {
126+ throw new InvalidArgumentException (
127+ sprintf ('No job with identifier "%s" found ' , $ this ->jobIdentifier ),
127128 1660661997 );
128129 }
129130
130131 try {
131132 $ this ->publish ();
132133 } catch (\Throwable $ t ) {
133- $ job ->setStatus (Job::STATUS_DONE );
134-
135134 $ error = new Error ();
136135 $ error ->setMessage ($ t ->getMessage ());
137136
@@ -143,6 +142,7 @@ public function execute(QueueInterface $queue, Message $message): bool
143142 );
144143 $ this ->feedbackCollection ->setControllerContext ($ controllerContext );
145144
145+ $ job = $ this ->jobRepository ->findByIdentifier ($ this ->jobIdentifier );
146146 $ job ->setFeedback ($ this ->feedbackCollection ->jsonSerialize ());
147147 $ job ->setStatus (Job::STATUS_DONE );
148148 $ this ->jobRepository ->update ($ job );
0 commit comments