Wait for astral to have attribute 'location' before using it #185
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Sometimes while initializing the component the
astral
module doesn't have thelocation
attribute yet when the component tries to use it, cause bugs like #148, #149 and #175.This PR implements a loop that causes initialization to wait another second if the attribute isn't available yet. If it still isn't available after 30 seconds we let the initialization continue and crash, like before.
I have been running with a simpler version of the fix (a single 10 second sleep) for months, which has completely fixed the issue for me, but this version is a bit more clever to avoid waiting longer than necessary while also being more resilient in case longer is needed.
Closes #149, closes #175.