1
0
mirror of https://github.com/chubin/cheat.sh.git synced 2026-06-20 05:06:44 +02:00
Files
cheat.sh/lib/stateful_queries.py
2025-07-29 20:07:59 +02:00

20 lines
346 B
Python

"""
Support for the stateful queries
"""
import cache
def save_query(client_id, query):
"""
Save the last query `query` for the client `client_id`
"""
cache.put("l:%s" % client_id, query)
def last_query(client_id):
"""
Return the last query for the client `client_id`
"""
return cache.get("l:%s" % client_id)