Skip to content

Commit

Permalink
i3 cli hangs issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ciur committed Dec 15, 2024
1 parent 944a9bf commit 5ce477d
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 14 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ name: Build Image
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+\-rc[0-9]+'
- '[0-9]+.[0-9]+.[0-9]+\-b[0-9]+'
- '[0-9]+.[0-9]+.[0-9]+rc[0-9]+'
- '[0-9]+.[0-9]+.[0-9]+b[0-9]+'
- '[0-9]+.[0-9]+.[0-9]+'
- '[0-9]+.[0-9]+\-rc[0-9]+'
- '[0-9]+.[0-9]+\-b[0-9]+'
- '[0-9]+.[0-9]+rc[0-9]+'
- '[0-9]+.[0-9]+b[0-9]+'
- '[0-9]+.[0-9]+'

jobs:
Expand Down
9 changes: 6 additions & 3 deletions i3worker/cli/app.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import logging
import uuid
from typing import Optional
import typer
Expand All @@ -16,7 +17,7 @@
engine = create_engine(settings.papermerge__search__url)
schema_manager = SchemaManager(engine, model=IndexEntity)


logger = logging.getLogger(__name__)
index = IndexRW(engine, schema=IndexEntity)

NodeIDsType = Annotated[
Expand All @@ -38,8 +39,9 @@ def index_cmd(
start indexing the rest of the documents
`--dry-run`
"""

logger.debug("index cmd")
with Session() as db_session:
logger.debug("getting nodes")
nodes = api.get_nodes(db_session, node_ids)
items = [] # to be added to the index
for node in nodes:
Expand Down Expand Up @@ -79,8 +81,9 @@ def index_cmd(
if rebuild:
# drop all documents from the index
index.remove(query="*:*")

logger.debug("adding items")
for item in items:
logger.debug(f"adding item {item}")
index.add(item)


Expand Down
12 changes: 6 additions & 6 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "i3worker"
version = "0.3.0"
version = "0.3.1b1"
description = "Sync DB with search index"
authors = ["Eugen Ciur <[email protected]>"]
readme = "README.md"
Expand Down

0 comments on commit 5ce477d

Please sign in to comment.