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

Attempt new login on 401 error #13

Merged
merged 2 commits into from
Sep 8, 2023
Merged

Attempt new login on 401 error #13

merged 2 commits into from
Sep 8, 2023

Conversation

hbruch
Copy link
Collaborator

@hbruch hbruch commented Sep 6, 2023

This PR:

  • attempts to login again in case of a 401 reply, which can happen when the same credentials are used in a different session
  • catches and logs exceptions when the generation of a feed fails for a provider
  • in single-run mode, terminates with exit code 1 when feed generation was not successful for at least one provider

fixes #12

x2gbfs/x2gbfs.py Outdated Show resolved Hide resolved
@derhuerst derhuerst changed the title Attempt new login on 401 error (fixes #12) Attempt new login on 401 error Sep 6, 2023
x2gbfs/x2gbfs.py Outdated Show resolved Hide resolved
i.e. use exponential backoff and some random jitter,
and only catch HttpErrors so coding issues won't slip silently
@derhuerst derhuerst merged commit 1713779 into main Sep 8, 2023
1 check passed
@derhuerst derhuerst deleted the issues/12 branch September 8, 2023 18:21
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.

Fleetster API should acquire new token in case of 401 response
2 participants