Skip to content

Commit

Permalink
chore: fix duplicated add
Browse files Browse the repository at this point in the history
  • Loading branch information
zwpaper committed Nov 25, 2024
1 parent b447bf0 commit 5d0f6af
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ impl SchedulerGithubGitlabJob {
let mut num_deleted = 0;
for await (state, doc) in issue_stream.chain(pull_stream) {
let id = &doc.id().to_owned();
if index.add(state.updated_at, doc).await {
if !state.should_clean && index.add(state.updated_at, doc).await {

Check warning on line 146 in ee/tabby-webserver/src/service/background_job/third_party_integration.rs

View check run for this annotation

Codecov / codecov/patch

ee/tabby-webserver/src/service/background_job/third_party_integration.rs#L143-L146

Added lines #L143 - L146 were not covered by tests
num_updated += 1
}
if state.should_clean && index.delete(id).await {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ pub async fn list_github_issues(
};
yield (FetchState {
updated_at: issue.updated_at,
should_clean: false,
should_clean: false,
}, doc);

Check warning on line 69 in ee/tabby-webserver/src/service/background_job/third_party_integration/issues.rs

View check run for this annotation

Codecov / codecov/patch

ee/tabby-webserver/src/service/background_job/third_party_integration/issues.rs#L66-L69

Added lines #L66 - L69 were not covered by tests
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ pub async fn list_github_pulls(
updated_at: pull.updated_at.unwrap(),
should_clean: true,
}, doc);
continue;

Check warning on line 68 in ee/tabby-webserver/src/service/background_job/third_party_integration/pulls.rs

View check run for this annotation

Codecov / codecov/patch

ee/tabby-webserver/src/service/background_job/third_party_integration/pulls.rs#L64-L68

Added lines #L64 - L68 were not covered by tests
}
}

Expand Down

0 comments on commit 5d0f6af

Please sign in to comment.