fix mongo fallback sampling for deep links

This commit is contained in:
root
2026-04-16 14:12:37 +08:00
parent 7fff1a9944
commit b17bce24e9

View File

@@ -863,10 +863,13 @@ class VideoService
} }
for ($attempt = 0; $attempt < 6; $attempt++) { for ($attempt = 0; $attempt < 6; $attempt++) {
$cursor = $this->VideoModel->getCol()->aggregate([ $arrPipeline = [];
['$match' => $arrFilter], if (!empty($arrFilter)) {
['$sample' => ['size' => 8]], $arrPipeline[] = ['$match' => (object)$arrFilter];
]); }
$arrPipeline[] = ['$sample' => ['size' => 8]];
$cursor = $this->VideoModel->getCol()->aggregate($arrPipeline);
$arrRows = iterator_to_array($cursor); $arrRows = iterator_to_array($cursor);
$this->debugFallbackProbe('sample_attempt', [ $this->debugFallbackProbe('sample_attempt', [