This repository was archived by the owner on Dec 20, 2024. It is now read-only.
Commit e7841a6 1 parent 048bc35 commit e7841a6 Copy full SHA for e7841a6
File tree 1 file changed +8
-2
lines changed
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -47,20 +47,26 @@ public function handle()
47
47
ProcessNewVolumeFiles::dispatch ($ volume );
48
48
});
49
49
50
+ // Give the ProcessNewVolumeFiles jobs a head start so the file thumbnails are
51
+ // generated (mostly) before the annotation thumbnails.
52
+ $ delay = now ()->addSeconds (30 );
53
+
50
54
if (class_exists (ProcessAnnotatedImage::class)) {
51
55
Image::whereIn ('images.volume_id ' , $ this ->ids )
52
56
->whereHas ('annotations ' )
53
- ->eachById (function ($ image ) {
57
+ ->eachById (function ($ image ) use ( $ delay ) {
54
58
ProcessAnnotatedImage::dispatch ($ image )
59
+ ->delay ($ delay )
55
60
->onQueue (config ('largo.generate_annotation_patch_queue ' ));
56
61
}, 1000 );
57
62
}
58
63
59
64
if (class_exists (ProcessAnnotatedVideo::class)) {
60
65
Video::whereIn ('videos.volume_id ' , $ this ->ids )
61
66
->whereHas ('annotations ' )
62
- ->eachById (function ($ video ) {
67
+ ->eachById (function ($ video ) use ( $ delay ) {
63
68
ProcessAnnotatedVideo::dispatch ($ video )
69
+ ->delay ($ delay )
64
70
->onQueue (config ('largo.generate_annotation_patch_queue ' ));
65
71
}, 1000 );
66
72
}
You can’t perform that action at this time.
0 commit comments