From e3bd7ea445acb2ab919b49a26ce8db02642572c4 Mon Sep 17 00:00:00 2001 From: Swann Date: Tue, 12 Jan 2021 10:29:27 +0100 Subject: [PATCH] feat: improve commit times by using cache from the diff --- multi_user/__init__.py | 2 +- multi_user/timers.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/multi_user/__init__.py b/multi_user/__init__.py index efa18cd..1bb10b1 100644 --- a/multi_user/__init__.py +++ b/multi_user/__init__.py @@ -44,7 +44,7 @@ from . import environment DEPENDENCIES = { - ("replication", '0.1.21'), + ("replication", '0.1.22'), } diff --git a/multi_user/timers.py b/multi_user/timers.py index ab70bfb..acf6c10 100644 --- a/multi_user/timers.py +++ b/multi_user/timers.py @@ -138,13 +138,13 @@ class PushTimer(Timer): def execute(self): while self.q_push: - node_id = self.q_push.pop() - - node = session.get(uuid=node_id) + node = session.get(uuid= self.q_push.pop()) + start = utils.current_milli_time() + if node.has_changed(): try: session.commit(node.uuid) - session.push(node.uuid) + session.push(node.uuid, check_data=False) except ReferenceError: logging.debug(f"Reference error {node.uuid}") if not node.is_valid():