Skip to content

Off hours access token refresh #55

@BobGlicksman

Description

@BobGlicksman

The current station firmware checks to see if the Amilia access token is valid at about 8 am each day. If the token has expired, a new token is obtained so that the token shouldn't need to be refreshed during normal operational hours. However, if a station is powered up during the day and needs a new token, it will get a token that is not refreshed the next 8 am but will need to be refreshed in the middle of the operational day. Also, tokens are set to expire (by us) about 1 second less than 24 hours since the token was obtained, which means that the 8 am check (which has a little randomness to its time) may or may not detect a token that is about to expire, meaning that a new token will need to be gotten when the station is next operated.

Perhaps we should (a) always get a new token at 8 am each day, regardless of whether the current token has expired or not, or (b) set the token lifetime to be e.g. 23 hours, so that a token gotten at about 8 am one day will have expired at 8 am the next day.

The occasional getting a new token does not take very long with Amilia, so this is not an urgent issue. However, it would be best to ensure that we have a fresh token at 8 am each day, so that a new token will only be needed during the operational day if the station is power-cycled.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions