本文整理汇总了Python中couchbase.bucket.Bucket.n1ql_timeout方法的典型用法代码示例。如果您正苦于以下问题:Python Bucket.n1ql_timeout方法的具体用法?Python Bucket.n1ql_timeout怎么用?Python Bucket.n1ql_timeout使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类couchbase.bucket.Bucket
的用法示例。
在下文中一共展示了Bucket.n1ql_timeout方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_rev_ids
# 需要导入模块: from couchbase.bucket import Bucket [as 别名]
# 或者: from couchbase.bucket.Bucket import n1ql_timeout [as 别名]
def get_rev_ids(cb_id_arr):
statement = ("SELECT _sync.rev as rev_id FROM "
+ BUCKET + " USE KEYS " + str(cb_id_arr))
try:
bucket = Bucket(URL)
bucket.n1ql_timeout = TIMEOUT
query = N1QLQuery(statement)
query.timeout = TIMEOUT
res = bucket.n1ql_query(query)
except (RequestException, CouchbaseTransientError, CouchbaseNetworkError) as err:
logger.error(err)
return _dict2json(res, False)
示例2: _get_all
# 需要导入模块: from couchbase.bucket import Bucket [as 别名]
# 或者: from couchbase.bucket.Bucket import n1ql_timeout [as 别名]
def _get_all(statement):
try:
bucket = Bucket(URL)
bucket.n1ql_timeout = TIMEOUT
lg.write_to_log("\n", _log_file_name)
lg.write_to_log("<" + str(dt.datetime.utcnow()) + "> : ", _log_file_name)
lg.write_to_log("Query: " + statement + "; ", _log_file_name)
query = N1QLQuery(statement)
query.timeout = TIMEOUT
res = bucket.n1ql_query(query)
except (RequestException, CouchbaseTransientError, CouchbaseNetworkError) as err:
logger.error(err)
sys.exit(1)
return res