Skip to content

Commit

Permalink
add file caching
Browse files Browse the repository at this point in the history
  • Loading branch information
pizzapanther committed Sep 1, 2023
1 parent e9b30c0 commit a5133c0
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
19 changes: 19 additions & 0 deletions wwfunc/packages/wildweb/zrelease/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import requests

from filecache import filecache

@filecache(5 * 60)
def main():
resp = requests.get("https://api.github.com/repos/pizzapanther/wildwoodag-v2/releases/latest")
data = resp.json()
print("retrieved new data")

version = data["tag_name"].replace("v", "")
url = data["assets"][0]["browser_download_url"]

return {
"body": {
"version": version,
"url": url
}
}
7 changes: 7 additions & 0 deletions wwfunc/packages/wildweb/zrelease/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

set -e

virtualenv --without-pip virtualenv

pip install -r requirements.txt --target virtualenv/lib/python3.11/site-packages
1 change: 1 addition & 0 deletions wwfunc/packages/wildweb/zrelease/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
filecache==0.81

0 comments on commit a5133c0

Please sign in to comment.