diff --git a/app/Jobs/HomeFeedPipeline/FeedWarmCachePipeline.php b/app/Jobs/HomeFeedPipeline/FeedWarmCachePipeline.php new file mode 100644 index 000000000..00cdbda65 --- /dev/null +++ b/app/Jobs/HomeFeedPipeline/FeedWarmCachePipeline.php @@ -0,0 +1,67 @@ +pid; + } + + /** + * Get the middleware the job should pass through. + * + * @return array + */ + public function middleware(): array + { + return [(new WithoutOverlapping("hfp:warm-cache:pid:{$this->pid}"))->shared()->dontRelease()]; + } + + /** + * Create a new job instance. + */ + public function __construct($pid) + { + $this->pid = $pid; + } + + /** + * Execute the job. + */ + public function handle(): void + { + $pid = $this->pid; + HomeTimelineService::warmCache($pid, true, 400, true); + } +}