Polling and storing feature flags in cache #1055
-
I'd like to store all features in cache. I need to refresh this cache on a daily basis, specifically just once a day. How may I poll all of my features at once? |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 5 replies
-
Beta Was this translation helpful? Give feedback.
-
Hiya - the Python SDK has a PollingEdgeService class - you can see the code here where it does the call out? given a successful response, you can see it just decodes it and passes it to a method: which parses it and then passes it to the repository. If you do the same call and save the resulting json instead and when you load it, mimic the method and then load it into the repository using the same mechanism that will do what you want I think? |
Beta Was this translation helpful? Give feedback.
-
Thank you for the response!
|
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Thank you very much :) |
Beta Was this translation helpful? Give feedback.
Yes, there isn't anything from the Python SDK out of the box to save the response to somewhere, no. It should only be a few lines of Python however, which is a good thing!
I'm going to have to give you some adhoc code here rather than something specifically out of the box working, so here goes: