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

Stata license caching can break user's setup for ~2 hours #734

Open
bloodearnest opened this issue Jun 10, 2024 · 1 comment
Open

Stata license caching can break user's setup for ~2 hours #734

bloodearnest opened this issue Jun 10, 2024 · 1 comment

Comments

@bloodearnest
Copy link
Member

Currently, we will only ask Github for the license again if its > 2 hours since the last fetch.

This sometimes causes issues where a user tries to run a stata action locally, but is not logged in to the Github Desktop app. The fetch fails because of lack of auth, and the old license file is used, and its timestamp updated. So we will not attempt to fetch again for 2 hours, even though the user may have now logged in to Github Desktop.

Ideally, we'd know if the license was expired on fetch, but we can't know that without running a stata job.

One may be to detect if the failure to fetch the license was due to auth failure, or some other reason. If due to auth, we could not update the file timestamp (or possibly update it with a very short time, e.g. 2 min), to trigger re-fetching much sooner.

@bloodearnest
Copy link
Member Author

Longer term, I think the current implementation is overly complicated for something that only changes once per year. An alternative would be to add an opensafely stata-license command, which fetches and verifies the current license, and stores it locally somewhere (this being the hard bit).

We can then handle license expired errors and prompt the user to a) ensure they are logged in to github and b) run opensafely stata-license to get the latest version. We could then also easily support setting the license manually with something like opensafely stata-license MYLICENSE

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

No branches or pull requests

1 participant