Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions atcoder-problems-backend/crawler/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ impl CrawlerClient {
);
let request = self.client.get(&url);
let response = request.send().await?;
if response.status() == 404 {
return Err(CrawlerError::NotFound);
}
if !response.status().is_success() {
return Err(CrawlerError::HttpError(response.text().await?));
}
Expand Down
8 changes: 8 additions & 0 deletions atcoder-problems-backend/src/crawler_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ pub async fn fetch_submissions(
Ok(submissions) => {
return submissions;
}
Err(CrawlerError::NotFound) => {
tracing::warn!(
"Submissions page not found for contest {} page {} (404), skipping",
contest_id,
page
);
return vec![];
}
Err(e) => {
retry_count += 1;
tracing::warn!(
Expand Down
Loading