diff --git a/src/server.py b/src/server.py --- a/src/server.py +++ b/src/server.py @@ -94,7 +94,9 @@ class Server(NetNode): if json_data["action"]=="pull" and self.is_locked(): self._outcoming.write_msg({"command": "deny", "status": status.locked}) if json_data["action"]=="push" and not self.is_locked(): - self._lock() + try: self._lock() + except Exception: + pass self._last_flushed = datetime.now().timestamp() self._outcoming.write_msg({"command": "init", "version": conf.version}) @@ -151,6 +153,7 @@ class Server(NetNode): t = datetime.now().timestamp() if t-self._last_flushed>=60: + self._data_file.flush() if self._tree_file: self._update_tree() self._refresh_lock()