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

add support for ovos api service and caching #2

Merged
merged 6 commits into from
Feb 18, 2022

Conversation

AIIX
Copy link

@AIIX AIIX commented Feb 11, 2022

  • Add support for Open Voice OS API service
  • Add caching of results

@JarbasAl
Copy link
Member

weather data is not valid for very long, it should expire every hour or so

could we use requests cache? its used in a few f our packages already and usually already installed, it handles all this automatically and behind the scenes

skill/__init__.py Outdated Show resolved Hide resolved
skill/weather.py Outdated Show resolved Hide resolved
@AIIX
Copy link
Author

AIIX commented Feb 14, 2022

weather data is not valid for very long, it should expire every hour or so

could we use requests cache? its used in a few f our packages already and usually already installed, it handles all this automatically and behind the scenes

I seem to get quite a few errors with request cache, I would prefer for now to handle our own cache mechanism, this is also because its not caching 1 single result it will cache all results "what is the current weather in london" and "what is the current weather (in current location)" as well, the caching in this is set based on lat / lon co-ordinates instead. The timeout is set as per the general weather radar systems timeout, was reading into this while setting the timeout, weather radars generally update every 15 minutes, caching any longer would mean incorrect weather results on the homescreen and when asked for weather report.

@JarbasAl
Copy link
Member

requests cache was just a suggestion, the main take away is expiring the cache somehow after some time, maybe just save a unix timestamp together with the cache and when reading from cache check the timestamp?

@AIIX AIIX merged commit 9748286 into 21.02 Feb 18, 2022
@JarbasAl JarbasAl deleted the add/feat/ovos_backend_api branch March 2, 2022 02:46
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

Successfully merging this pull request may close these issues.

None yet

2 participants