mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
Merge branch 'wrap-queries-in-connection-class'
This commit is contained in:
commit
425d6714ac
@ -138,11 +138,11 @@ class Bigchain(object):
|
|||||||
# There is no other node to assign to
|
# There is no other node to assign to
|
||||||
new_assignee = self.me
|
new_assignee = self.me
|
||||||
|
|
||||||
response = r.table('backlog')\
|
response = self.connection.run(
|
||||||
.get(transaction['id'])\
|
r.table('backlog')
|
||||||
.update({'assignee': new_assignee,
|
.get(transaction['id'])
|
||||||
'assignment_timestamp': time()},
|
.update({'assignee': new_assignee, 'assignment_timestamp': time()},
|
||||||
durability=durability).run(self.conn)
|
durability=durability))
|
||||||
return response
|
return response
|
||||||
|
|
||||||
def get_stale_transactions(self):
|
def get_stale_transactions(self):
|
||||||
@ -152,9 +152,9 @@ class Bigchain(object):
|
|||||||
backlog after some amount of time specified in the configuration
|
backlog after some amount of time specified in the configuration
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return r.table('backlog')\
|
return self.connection.run(
|
||||||
.filter(lambda tx: time() - tx['assignment_timestamp'] >
|
r.table('backlog')
|
||||||
self.backlog_reassign_delay).run(self.conn)
|
.filter(lambda tx: time() - tx['assignment_timestamp'] > self.backlog_reassign_delay))
|
||||||
|
|
||||||
def validate_transaction(self, transaction):
|
def validate_transaction(self, transaction):
|
||||||
"""Validate a transaction.
|
"""Validate a transaction.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user