Skip to content

Commit 66a84ec

Browse files
committed
use global
1 parent 62f8e37 commit 66a84ec

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

website/app.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,12 @@ def serve_js(filename):
2727
return send_from_directory('source/js', filename)
2828

2929
# community projects are cached to prevent spamming Scratch's API
30-
community_projects_cache = []
30+
community_projects_cache: list[dict] = []
3131
last_cache_time = 0
3232

3333
@app.route('/api/community_projects/')
3434
def community_projects():
35+
global community_projects_cache
3536
if time.time() - 300 > last_cache_time:
3637
projects = sa.Studio(id=31478892).projects(limit=40)
3738
if isinstance(projects[0], dict): #atm the server this is running on still uses scratchattach 1.7.4 that returns a list of dicts here

0 commit comments

Comments
 (0)