Skip to content

Commit

Permalink
Reddit RateLimit variables should be unique per instance
Browse files Browse the repository at this point in the history
  • Loading branch information
caronc committed Jul 9, 2023
1 parent a94700b commit d7a5a60
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions apprise/plugins/NotifyReddit.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,6 @@ class NotifyReddit(NotifyBase):
# still allow to make.
request_rate_per_sec = 0

# For Tracking Purposes
ratelimit_reset = datetime.now(timezone.utc).replace(tzinfo=None)

# Default to 1.0
ratelimit_remaining = 1.0

# Taken right from google.auth.helpers:
clock_skew = timedelta(seconds=10)

Expand Down Expand Up @@ -326,6 +320,13 @@ def __init__(self, app_id=None, app_secret=None, targets=None,
if not self.subreddits:
self.logger.warning(
'No subreddits were identified to be notified')

# For Rate Limit Tracking Purposes
self.ratelimit_reset = datetime.now(timezone.utc).replace(tzinfo=None)

# Default to 1.0
self.ratelimit_remaining = 1.0

return

def url(self, privacy=False, *args, **kwargs):
Expand Down

0 comments on commit d7a5a60

Please sign in to comment.