feat: improve commit times by using cache from the diff

This commit is contained in:
Swann
2021-01-12 10:29:27 +01:00
parent 12bd4a603b
commit e3bd7ea445
2 changed files with 5 additions and 5 deletions

View File

@ -44,7 +44,7 @@ from . import environment
DEPENDENCIES = { DEPENDENCIES = {
("replication", '0.1.21'), ("replication", '0.1.22'),
} }

View File

@ -138,13 +138,13 @@ class PushTimer(Timer):
def execute(self): def execute(self):
while self.q_push: while self.q_push:
node_id = self.q_push.pop() node = session.get(uuid= self.q_push.pop())
start = utils.current_milli_time()
node = session.get(uuid=node_id)
if node.has_changed(): if node.has_changed():
try: try:
session.commit(node.uuid) session.commit(node.uuid)
session.push(node.uuid) session.push(node.uuid, check_data=False)
except ReferenceError: except ReferenceError:
logging.debug(f"Reference error {node.uuid}") logging.debug(f"Reference error {node.uuid}")
if not node.is_valid(): if not node.is_valid():