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

custom_token isn't being passed to child Spotter workers #13

Open
g-mo opened this issue Dec 3, 2021 · 2 comments · May be fixed by #45
Open

custom_token isn't being passed to child Spotter workers #13

g-mo opened this issue Dec 3, 2021 · 2 comments · May be fixed by #45

Comments

@g-mo
Copy link
Contributor

g-mo commented Dec 3, 2021

When using custom_token to initialize SofarApi, the custom token does not get passed into the Spotter workers. The Spotter workers will then each create their own instance of SofarApi that uses the WF_API_TOKEN environment variable, possibly resulting in failed queries due to using a wrong or missing token

@pieterbartsmit
Copy link
Contributor

@g-mo this is a rather tricky issue it seems. It is not always obvious when a new instance of the connection class gets created, and when the updated token needs to be passed.

From a user perspective- I am inclined to not tie a token to an object instance, but make it a global property instead. The case where you would want to have multiple connections with different keys seems somewhat niche- and it seems more intuitive to me that once a User sets a new Token - the get_token function just returns that token.

Complication is that currently tokens are also stored in the header parts of the sofarconnection objects, which would not automatically get updated on a change of state. Maybe adding the token to the header should be left to the point where we do a call to get/post etc.?

@pieterbartsmit
Copy link
Contributor

@tcj for visibility

@tcj tcj linked a pull request Oct 4, 2024 that will close this issue
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 a pull request may close this issue.

2 participants