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

Don't keep fetching snitun token when sub expired #168

Merged
merged 1 commit into from
Jun 21, 2020

Conversation

balloob
Copy link
Member

@balloob balloob commented Jun 21, 2020

When sub expired, don't try to keep fetching snitun tokens.

This is a quick fix. In the future we should redo this code to have "sub activated" and "sub deactivated" hooks.

@@ -283,6 +291,8 @@ async def connect(self) -> None:
_LOGGER.error("Connection problem to snitun server")
except RemoteBackendError:
_LOGGER.error("Can't refresh the snitun token")
except SubscriptionExpired:
pass
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we communicate this state some other way to interested parties?

Copy link
Member Author

Choose a reason for hiding this comment

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

No. We just have this property which is updated once an hour when we update auth tokens. Future PR we can add some logic for responding to that.

@balloob balloob merged commit 307bf3e into master Jun 21, 2020
@balloob balloob deleted the dont-connect-if-sub-expired branch June 21, 2020 20:58
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