ttl

判断key的剩余的ttl时间

  1. def ttl(self, hash_key, sort_key, timeout=0):
  2. """
  3. Get ttl(time to live) of the data.
  4. :param hash_key: (str) which hash key used for this API.
  5. :param sort_key: (str) which sort key used for this API.
  6. :param timeout: (int) how long will the operation timeout in milliseconds.
  7. if timeout > 0, it is a timeout value for current operation,
  8. else the timeout value specified to create the instance will be used.
  9. :return: (tuple<error_types.code.value, int>) (code, ttl)
  10. code: error_types.ERR_OK.value when data exist, error_types.ERR_OBJECT_NOT_FOUND.value when data not found.
  11. ttl: in seconds, -1 means forever.
  12. """