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

set time-to-live for webpush messages #185

Merged
merged 8 commits into from
Mar 29, 2021
Merged

Conversation

bwindels
Copy link
Contributor

Configurable with a default of 15 minutes.

@bwindels bwindels requested a review from callahad March 26, 2021 10:59
Comment on lines 123 to 128
self.ttl = self.get_config("ttl")
if self.ttl:
if not isinstance(self.ttl, int):
raise PushkinSetupException("'ttl' must be an int if set")
else:
self.ttl = DEFAULT_TTL
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be cleaner to do this?

self.ttl = self.get_config("ttl", DEFAULT_TTL)
if not isinstance(self.ttl, int):
    raise PushkinSetupException("'ttl' must be an int if set")

@callahad
Copy link
Contributor

Do we need to document the ttl configuration anywhere? (The VAPID config isn't documented either, so I guess we can let this slip, too, while WebPush is experimental)

Does ttl need to be added to the UNDERSTOOD_CONFIG_FIELDS list?

@bwindels
Copy link
Contributor Author

Thanks for the review @callahad, ready for another look.

@bwindels bwindels requested a review from callahad March 29, 2021 09:24
@callahad
Copy link
Contributor

r+ once CI passes and if you promise that you've tested this locally and it at least appears to work.

@bwindels
Copy link
Contributor Author

@callahad Have tested again, all seems to work 👍

@callahad callahad merged commit 9d719c7 into master Mar 29, 2021
@callahad callahad deleted the bwindels/webpush-ttl branch March 29, 2021 10:56
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.

2 participants