From 40060858182dd8c607855e01216a5d931980d886 Mon Sep 17 00:00:00 2001 From: Andreas Saks Date: Wed, 17 Apr 2024 00:12:59 +0200 Subject: [PATCH] Fixed subreddit skip during user archiving --- app/Services/RedditParser.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/Services/RedditParser.php b/app/Services/RedditParser.php index 795fc2c..59a1636 100644 --- a/app/Services/RedditParser.php +++ b/app/Services/RedditParser.php @@ -239,10 +239,6 @@ public function archiveTopUsers(string $sort = 'top', string $topBy = 'year') } foreach ($jsonPosts->data->children as $post) { - if ($post->data->subreddit !== 'osugame') { - continue; - } - // wrap post in array to match the structure of the getComments response $post = $this->wrapPostInGetCommentsStructure($post); @@ -253,6 +249,11 @@ public function archiveTopUsers(string $sort = 'top', string $topBy = 'year') } $after = $newAfter; + $postsProcessed++; + if ($post[0]->data->children[0]->data->subreddit !== 'osugame') { + continue; + } + try { $this->prepareParse($post, true); } catch (Throwable $exception) { @@ -263,7 +264,6 @@ public function archiveTopUsers(string $sort = 'top', string $topBy = 'year') throw $exception; } - $postsProcessed++; } } }, 5);