You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
344 B

  1. """
  2. Support for the stateful queries
  3. """
  4. import cache
  5. def save_query(client_id, query):
  6. """
  7. Save the last query `query` for the client `client_id`
  8. """
  9. cache.put("l:%s" % client_id, query)
  10. def last_query(client_id):
  11. """
  12. Return the last query for the client `client_id`
  13. """
  14. return cache.get("l:%s" % client_id)