Skip to content

Commit

Permalink
Fixed subreddit skip during user archiving
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrusowski committed Apr 16, 2024
1 parent aef5bae commit 4006085
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/Services/RedditParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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) {
Expand All @@ -263,7 +264,6 @@ public function archiveTopUsers(string $sort = 'top', string $topBy = 'year')

throw $exception;
}
$postsProcessed++;
}
}
}, 5);
Expand Down

0 comments on commit 4006085

Please sign in to comment.