From 7c789d360f8241f1481bf4f9c73e28bcc9a67b93 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 21 Mar 2024 16:04:29 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- pycrdt_websocket/ystore.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/pycrdt_websocket/ystore.py b/pycrdt_websocket/ystore.py index df7e8ce..cb015fb 100644 --- a/pycrdt_websocket/ystore.py +++ b/pycrdt_websocket/ystore.py @@ -10,11 +10,11 @@ from pathlib import Path from typing import AsyncIterator, Awaitable, Callable, cast -from sqlite_anyio import connect import anyio from anyio import TASK_STATUS_IGNORED, Event, Lock, create_task_group from anyio.abc import TaskGroup, TaskStatus from pycrdt import Doc +from sqlite_anyio import connect from .yutils import Decoder, get_new_path, write_var_uint @@ -419,8 +419,7 @@ async def write(self, data: bytes) -> None: # first, determine time elapsed since last update cursor = await self._db.cursor() await cursor.execute( - "SELECT timestamp FROM yupdates WHERE path = ? " - "ORDER BY timestamp DESC LIMIT 1", + "SELECT timestamp FROM yupdates WHERE path = ? " "ORDER BY timestamp DESC LIMIT 1", (self.path,), ) row = await cursor.fetchone() @@ -429,9 +428,7 @@ async def write(self, data: bytes) -> None: if self.document_ttl is not None and diff > self.document_ttl: # squash updates ydoc = Doc() - await cursor.execute( - "SELECT yupdate FROM yupdates WHERE path = ?", (self.path,) - ) + await cursor.execute("SELECT yupdate FROM yupdates WHERE path = ?", (self.path,)) for (update,) in await cursor.fetchall(): ydoc.apply_update(update) # delete history