Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e0f2114736 | |||
| bac773ae4b | |||
| 564a9b68a5 | |||
| 7742673cc0 | |||
| c157c37cde |
@@ -38,6 +38,7 @@ def _get_vector_store() -> PGVector:
|
|||||||
connection=_pgvector_url,
|
connection=_pgvector_url,
|
||||||
use_jsonb=True,
|
use_jsonb=True,
|
||||||
create_extension=False, # created by docker init script
|
create_extension=False, # created by docker init script
|
||||||
|
async_mode=True,
|
||||||
)
|
)
|
||||||
return _vector_store
|
return _vector_store
|
||||||
|
|
||||||
@@ -59,6 +60,7 @@ text_splitter = RecursiveCharacterTextSplitter(
|
|||||||
def _get_collection_id():
|
def _get_collection_id():
|
||||||
"""Get the UUID of our collection from the langchain_pg_collection table."""
|
"""Get the UUID of our collection from the langchain_pg_collection table."""
|
||||||
engine = _get_engine()
|
engine = _get_engine()
|
||||||
|
try:
|
||||||
with engine.connect() as conn:
|
with engine.connect() as conn:
|
||||||
result = conn.execute(
|
result = conn.execute(
|
||||||
text("SELECT uuid FROM langchain_pg_collection WHERE name = :name"),
|
text("SELECT uuid FROM langchain_pg_collection WHERE name = :name"),
|
||||||
@@ -66,6 +68,9 @@ def _get_collection_id():
|
|||||||
)
|
)
|
||||||
row = result.fetchone()
|
row = result.fetchone()
|
||||||
return row[0] if row else None
|
return row[0] if row else None
|
||||||
|
except Exception:
|
||||||
|
# Table doesn't exist yet (first run before any indexing)
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
def date_to_epoch(date_str: str) -> float:
|
def date_to_epoch(date_str: str) -> float:
|
||||||
|
|||||||
+18
-1
@@ -7,9 +7,26 @@ aerich upgrade
|
|||||||
mkdir -p /app/data/obsidian
|
mkdir -p /app/data/obsidian
|
||||||
|
|
||||||
# Start continuous Obsidian sync if enabled
|
# Start continuous Obsidian sync if enabled
|
||||||
|
if [ "${OBSIDIAN_CONTINUOUS_SYNC}" = "true" ]; then
|
||||||
|
VAULT_PATH="${OBSIDIAN_VAULT_PATH:-/app/data/obsidian}"
|
||||||
|
|
||||||
|
# Setup sync if not already configured
|
||||||
|
if ! ob sync-status --path "$VAULT_PATH" > /dev/null 2>&1; then
|
||||||
|
echo "Configuring Obsidian sync..."
|
||||||
|
ob sync-setup \
|
||||||
|
--vault "${OBSIDIAN_VAULT_ID}" \
|
||||||
|
--path "$VAULT_PATH" \
|
||||||
|
--password "${OBSIDIAN_E2E_PASSWORD}" \
|
||||||
|
--device-name "${OBSIDIAN_DEVICE_NAME:-simbarag}" || {
|
||||||
|
echo "Failed to configure Obsidian sync. Skipping."
|
||||||
|
OBSIDIAN_CONTINUOUS_SYNC=false
|
||||||
|
}
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "${OBSIDIAN_CONTINUOUS_SYNC}" = "true" ]; then
|
if [ "${OBSIDIAN_CONTINUOUS_SYNC}" = "true" ]; then
|
||||||
echo "Starting Obsidian continuous sync in background..."
|
echo "Starting Obsidian continuous sync in background..."
|
||||||
ob sync --continuous &
|
ob sync --path "$VAULT_PATH" --continuous &
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Starting application..."
|
echo "Starting application..."
|
||||||
|
|||||||
Reference in New Issue
Block a user