You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ServiceConnector.get_access_token caches access tokens within the ServiceConnector object in case of repeated service calls, but firstly it doesn't handle them expiring, and secondly it would be useful to be able to store these in the cache and use them across instances, if still valid.
The text was updated successfully, but these errors were encountered:
Usually ServiceConnector instance (together with token) recreates on each request so there is no need to check expiration because in such case we may trust to external platform + usually ordinary request longs no longer than few seconds (ideally no longer than 0.1-0.2sec) so there is no need in such validation.
Problems could be in case of using instances in daemon mode but can't imagine situation where you operate with the same message_launch instance for a long time. Consequently ServiceConnector will be recreated together with the new message_launch instance.
it would be useful to be able to store these in the cache and use them across instances, if still valid.
Ideally there should be the separate background process that is responsible for creating/prolongation tokens only (based on cron or celery beat). There should be considered different variants of caches/frameworks... So i think this task is out of scope of this library for now.
I was thinking of the case where you need to update a lot of grades at once. You don't want to re-create the service connector for every grade because then it will request a new token each time, but also if you keep the token too long it may expire.
ServiceConnector.get_access_token
caches access tokens within the ServiceConnector object in case of repeated service calls, but firstly it doesn't handle them expiring, and secondly it would be useful to be able to store these in the cache and use them across instances, if still valid.The text was updated successfully, but these errors were encountered: