~sircmpwn/cgi-scripts

f26ae9b3939327fccc1e5186c301e67ddaa60f2c — Drew DeVault 3 years ago 42b809a
Move post cache to /tmp
1 files changed, 2 insertions(+), 2 deletions(-)

M hn.py
M hn.py => hn.py +2 -2
@@ 13,7 13,7 @@ path = os.environ.get("PATH_INFO")
if not path or path == "/":
    cache = None
    try:
        with open("post-cache.json") as f:
        with open("/tmp/post-cache.json") as f:
            cache = json.loads(f.read())
    except:
        pass


@@ 31,7 31,7 @@ if not path or path == "/":
                for i in j[:30]]
        posts = [p.json() for p in posts]
        # XXX: This is not thread-safe but who cares lol
        with open("post-cache.json", "w") as f:
        with open("/tmp/post-cache.json", "w") as f:
            f.write(json.dumps({
                "posts": posts,
                "date": datetime.timestamp(datetime.now()),