Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cleanup(reader/handler): calling store.UpdateFeed and store.UpdateFeedError in a defer function #2879

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

shizunge
Copy link
Contributor

@shizunge shizunge commented Oct 7, 2024

This makes sure that we are always calling the following functions:

  • originalFeed.ScheduleNextCheck
  • store.UpdateFeed
  • store.UpdateFeedError And we only call them in a single place regardless which branch is taken inside function.

The store functions within them will udpate the value in database.

This change aims to reduce "unknown unknowns" in the codes. With this change, we won't miss calling above functions.

Do you follow the guidelines?

This makes sure that we are always calling the following functions:
* originalFeed.ScheduleNextCheck
* store.UpdateFeed
* store.UpdateFeedError
And we only call them in a single place regardless which branch is taken inside function.

The store functions within them will udpate the value in database.

This change aims to reduce "unknown unknowns" in the codes. With this change, we won't miss calling above functions.
@shizunge shizunge changed the title calling store.UpdateFeed and store.UpdateFeedError in a defer function cleanup(reader/handler): calling store.UpdateFeed and store.UpdateFeedError in a defer function Oct 7, 2024
@shizunge shizunge marked this pull request as draft October 7, 2024 04:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant