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

Refactor subscribers and handle errors better #312

Merged
merged 7 commits into from
Sep 16, 2020
Merged

Refactor subscribers and handle errors better #312

merged 7 commits into from
Sep 16, 2020

Conversation

davidlougheed
Copy link
Member

Description

  • Improve performance of subscribers by caching some values in the cog instance
  • Avoid creating cog multiple times
  • Handle uncaught exceptions from the coroutines
  • Reduce repetition using a decorator

Motivation and Context

How Has This Been Tested?

  • Made sure subscribers still ran

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

jidicula
jidicula previously approved these changes Jul 27, 2020
Copy link
Member

@jidicula jidicula left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 question about filenaming but otherwise good to merge

@@ -0,0 +1,58 @@
# Copyright (C) idoneam (2016-2020)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this file be named differently to avoid confusing its purpose with cogs/subscribers.py?

le-potate
le-potate previously approved these changes Jul 27, 2020
Copy link
Contributor

@le-potate le-potate left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, could be a good idea to catch the exceptions happening in check_metro_status directly too. But this shouldn't crash anymore, and I tested and subscriber.py still works (food recalls were sent)

@davidlougheed davidlougheed dismissed stale reviews from le-potate and jidicula via 0cbd042 July 27, 2020 16:54
@davidlougheed
Copy link
Member Author

@le-potate will this conflict at all with the webhook logger stuff?

@davidlougheed davidlougheed merged commit f0a5215 into dev Sep 16, 2020
@davidlougheed davidlougheed deleted the issue-236 branch September 16, 2020 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants