@@ -150,51 +150,57 @@ private function registerDashboard(): void
150
150
});
151
151
152
152
app ('events ' )->listen (JobProcessing::class, function (JobProcessing $ event ) {
153
- if (!CloudTasks:: dashboardEnabled () ) {
153
+ if (!$ event -> job instanceof CloudTasksJob ) {
154
154
return ;
155
155
}
156
156
157
- if ($ event -> job instanceof CloudTasksJob ) {
157
+ if (CloudTasks:: dashboardEnabled () ) {
158
158
DashboardService::make ()->markAsRunning ($ event ->job ->uuid ());
159
159
}
160
160
});
161
161
162
162
app ('events ' )->listen (JobProcessed::class, function (JobProcessed $ event ) {
163
- data_set ($ event ->job ->job , 'internal.processed ' , true );
164
-
165
- if (!CloudTasks::dashboardEnabled ()) {
163
+ if (!$ event ->job instanceof CloudTasksJob) {
166
164
return ;
167
165
}
168
166
169
- if ($ event ->job instanceof CloudTasksJob) {
167
+ data_set ($ event ->job ->job , 'internal.processed ' , true );
168
+
169
+ if (CloudTasks::dashboardEnabled ()) {
170
170
DashboardService::make ()->markAsSuccessful ($ event ->job ->uuid ());
171
171
}
172
172
});
173
173
174
174
app ('events ' )->listen (JobExceptionOccurred::class, function (JobExceptionOccurred $ event ) {
175
- data_set ($ event ->job ->job , 'internal.errored ' , true );
176
-
177
- if (!CloudTasks::dashboardEnabled ()) {
175
+ if (!$ event ->job instanceof CloudTasksJob) {
178
176
return ;
179
177
}
180
178
181
- DashboardService::make ()->markAsError ($ event );
179
+ data_set ($ event ->job ->job , 'internal.errored ' , true );
180
+
181
+ if (CloudTasks::dashboardEnabled ()) {
182
+ DashboardService::make ()->markAsError ($ event );
183
+ }
182
184
});
183
185
184
186
app ('events ' )->listen (JobFailed::class, function ($ event ) {
185
- if (!CloudTasks:: dashboardEnabled () ) {
187
+ if (!$ event -> job instanceof CloudTasksJob ) {
186
188
return ;
187
189
}
188
190
189
- DashboardService::make ()->markAsFailed ($ event );
191
+ if (CloudTasks::dashboardEnabled ()) {
192
+ DashboardService::make ()->markAsFailed ($ event );
193
+ }
190
194
});
191
195
192
196
app ('events ' )->listen (JobReleased::class, function (JobReleased $ event ) {
193
- if (!CloudTasks:: dashboardEnabled () ) {
197
+ if ($ event -> job instanceof CloudTasksJob ) {
194
198
return ;
195
199
}
196
200
197
- DashboardService::make ()->markAsReleased ($ event );
201
+ if (CloudTasks::dashboardEnabled ()) {
202
+ DashboardService::make ()->markAsReleased ($ event );
203
+ }
198
204
});
199
205
}
200
206
}
0 commit comments