本文整理汇总了Python中couchbase.bucket.Bucket.unlock方法的典型用法代码示例。如果您正苦于以下问题:Python Bucket.unlock方法的具体用法?Python Bucket.unlock怎么用?Python Bucket.unlock使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类couchbase.bucket.Bucket
的用法示例。
在下文中一共展示了Bucket.unlock方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: SDKClient
# 需要导入模块: from couchbase.bucket import Bucket [as 别名]
# 或者: from couchbase.bucket.Bucket import unlock [as 别名]
#.........这里部分代码省略.........
cas=cas, check_removed=check_removed, timeout=timeout, interval=interval)
except CouchbaseError as e:
try:
time.sleep(10)
self.cb.endure(keys, persist_to=persist_to, replicate_to=replicate_to,
cas=cas, check_removed=check_removed, timeout=timeout, interval=interval)
except CouchbaseError as e:
raise
def lock(self, key, ttl=0):
try:
data = self.cb.lock(key, ttl = ttl)
return self.__translate_get(data)
except CouchbaseError as e:
try:
time.sleep(10)
data = self.cb.lock(key, ttl = ttl)
return self.__translate_get(data)
except CouchbaseError as e:
raise
def lock_multi(self, keys, ttl=0):
try:
data = self.cb.lock_multi(keys, ttl = ttl)
return self.__translate_get_multi(data)
except CouchbaseError as e:
try:
time.sleep(10)
data = self.cb.lock_multi(keys, ttl = ttl)
return self.__translate_get_multi(data)
except CouchbaseError as e:
raise
def unlock(self, key, ttl=0):
try:
return self.cb.unlock(key)
except CouchbaseError as e:
try:
time.sleep(10)
return self.cb.unlock(key)
except CouchbaseError as e:
raise
def unlock_multi(self, keys):
try:
return self.cb.unlock_multi(keys)
except CouchbaseError as e:
try:
time.sleep(10)
return self.cb.unlock_multi(keys)
except CouchbaseError as e:
raise
def n1ql_query(self, statement, prepared=False):
try:
return N1QLQuery(statement, prepared)
except CouchbaseError as e:
raise
def n1ql_request(self, query):
try:
return N1QLRequest(query, self.cb)
except CouchbaseError as e:
raise
def __translate_get_multi(self, data):