mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-31 19:45:15 +02:00
chore: ran linting
This commit is contained in:
parent
bc1f31b481
commit
ac0f2fa2eb
33 changed files with 688 additions and 661 deletions
|
|
@ -51,9 +51,7 @@ async def safe_set_chunks(
|
|||
from app.db import Chunk
|
||||
|
||||
if document.id is not None:
|
||||
await session.execute(
|
||||
delete(Chunk).where(Chunk.document_id == document.id)
|
||||
)
|
||||
await session.execute(delete(Chunk).where(Chunk.document_id == document.id))
|
||||
for chunk in chunks:
|
||||
chunk.document_id = document.id
|
||||
|
||||
|
|
|
|||
|
|
@ -37,9 +37,7 @@ async def safe_set_chunks(
|
|||
from app.db import Chunk
|
||||
|
||||
if document.id is not None:
|
||||
await session.execute(
|
||||
delete(Chunk).where(Chunk.document_id == document.id)
|
||||
)
|
||||
await session.execute(delete(Chunk).where(Chunk.document_id == document.id))
|
||||
for chunk in chunks:
|
||||
chunk.document_id = document.id
|
||||
|
||||
|
|
|
|||
|
|
@ -9,11 +9,9 @@ import re
|
|||
from datetime import UTC, datetime
|
||||
from pathlib import Path
|
||||
|
||||
from sqlalchemy import select
|
||||
from sqlalchemy import delete as sa_delete, select
|
||||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
from sqlalchemy.orm import selectinload
|
||||
|
||||
from sqlalchemy import delete as sa_delete
|
||||
from sqlalchemy.orm.attributes import set_committed_value
|
||||
|
||||
from app.config import config
|
||||
|
|
@ -39,6 +37,7 @@ async def _safe_set_docs_chunks(
|
|||
set_committed_value(document, "chunks", chunks)
|
||||
session.add_all(chunks)
|
||||
|
||||
|
||||
# Path to docs relative to project root
|
||||
DOCS_DIR = (
|
||||
Path(__file__).resolve().parent.parent.parent.parent
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue