File tree Expand file tree Collapse file tree 1 file changed +16
-8
lines changed Expand file tree Collapse file tree 1 file changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -162,18 +162,26 @@ public function postProcessCloning($volume)
162
162
{
163
163
ProcessNewVolumeFiles::dispatch ($ volume );
164
164
165
+ // Give the ProcessNewVolumeFiles job a head start so the file thumbnails are
166
+ // generated (mostly) before the annotation thumbnails.
167
+ $ delay = now ()->addSeconds (30 );
168
+
165
169
if (class_exists (ProcessAnnotatedImage::class)) {
166
- $ volume ->images ()->whereHas ('annotations ' )->eachById (function ($ image ) {
167
- ProcessAnnotatedImage::dispatch ($ image )
168
- ->onQueue (config ('largo.generate_annotation_patch_queue ' ));
169
- });
170
+ $ volume ->images ()->whereHas ('annotations ' )
171
+ ->eachById (function ($ image ) use ($ delay ) {
172
+ ProcessAnnotatedImage::dispatch ($ image )
173
+ ->delay ($ delay )
174
+ ->onQueue (config ('largo.generate_annotation_patch_queue ' ));
175
+ });
170
176
}
171
177
172
178
if (class_exists (ProcessAnnotatedVideo::class)) {
173
- $ volume ->videos ()->whereHas ('annotations ' )->eachById (function ($ video ) {
174
- ProcessAnnotatedVideo::dispatch ($ video )
175
- ->onQueue (config ('largo.generate_annotation_patch_queue ' ));
176
- });
179
+ $ volume ->videos ()
180
+ ->whereHas ('annotations ' )->eachById (function ($ video ) use ($ delay ) {
181
+ ProcessAnnotatedVideo::dispatch ($ video )
182
+ ->delay ($ delay )
183
+ ->onQueue (config ('largo.generate_annotation_patch_queue ' ));
184
+ });
177
185
}
178
186
}
179
187
You can’t perform that action at this time.
0 commit comments