Skip to content

Commit 99623a8

Browse files
committed
refactor: remove legacy Obsidian connector support
1 parent 16ea8e2 commit 99623a8

10 files changed

Lines changed: 46 additions & 1048 deletions

File tree

surfsense_backend/app/celery_app.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,6 @@ def parse_schedule_interval(interval: str) -> dict:
152152
"index_elasticsearch_documents": {"queue": CONNECTORS_QUEUE},
153153
"index_crawled_urls": {"queue": CONNECTORS_QUEUE},
154154
"index_bookstack_pages": {"queue": CONNECTORS_QUEUE},
155-
"index_obsidian_vault": {"queue": CONNECTORS_QUEUE},
156155
"index_composio_connector": {"queue": CONNECTORS_QUEUE},
157156
# Everything else (document processing, podcasts, reindexing,
158157
# schedule checker, cleanup) stays on the default fast queue.

surfsense_backend/app/routes/search_source_connectors_routes.py

Lines changed: 0 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,25 +1157,6 @@ async def index_connector_content(
11571157
)
11581158
response_message = "Web page indexing started in the background."
11591159

1160-
elif connector.connector_type == SearchSourceConnectorType.OBSIDIAN_CONNECTOR:
1161-
from app.config import config as app_config
1162-
from app.tasks.celery_tasks.connector_tasks import index_obsidian_vault_task
1163-
1164-
# Obsidian connector only available in self-hosted mode
1165-
if not app_config.is_self_hosted():
1166-
raise HTTPException(
1167-
status_code=400,
1168-
detail="Obsidian connector is only available in self-hosted mode",
1169-
)
1170-
1171-
logger.info(
1172-
f"Triggering Obsidian vault indexing for connector {connector_id} into search space {search_space_id} from {indexing_from} to {indexing_to}"
1173-
)
1174-
index_obsidian_vault_task.delay(
1175-
connector_id, search_space_id, str(user.id), indexing_from, indexing_to
1176-
)
1177-
response_message = "Obsidian vault indexing started in the background."
1178-
11791160
elif (
11801161
connector.connector_type
11811162
== SearchSourceConnectorType.COMPOSIO_GOOGLE_DRIVE_CONNECTOR
@@ -3048,59 +3029,6 @@ async def run_bookstack_indexing(
30483029
)
30493030

30503031

3051-
# Add new helper functions for Obsidian indexing
3052-
async def run_obsidian_indexing_with_new_session(
3053-
connector_id: int,
3054-
search_space_id: int,
3055-
user_id: str,
3056-
start_date: str,
3057-
end_date: str,
3058-
):
3059-
"""Wrapper to run Obsidian indexing with its own database session."""
3060-
logger.info(
3061-
f"Background task started: Indexing Obsidian connector {connector_id} into space {search_space_id} from {start_date} to {end_date}"
3062-
)
3063-
async with async_session_maker() as session:
3064-
await run_obsidian_indexing(
3065-
session, connector_id, search_space_id, user_id, start_date, end_date
3066-
)
3067-
logger.info(f"Background task finished: Indexing Obsidian connector {connector_id}")
3068-
3069-
3070-
async def run_obsidian_indexing(
3071-
session: AsyncSession,
3072-
connector_id: int,
3073-
search_space_id: int,
3074-
user_id: str,
3075-
start_date: str,
3076-
end_date: str,
3077-
):
3078-
"""
3079-
Background task to run Obsidian vault indexing.
3080-
3081-
Args:
3082-
session: Database session
3083-
connector_id: ID of the Obsidian connector
3084-
search_space_id: ID of the search space
3085-
user_id: ID of the user
3086-
start_date: Start date for indexing
3087-
end_date: End date for indexing
3088-
"""
3089-
from app.tasks.connector_indexers import index_obsidian_vault
3090-
3091-
await _run_indexing_with_notifications(
3092-
session=session,
3093-
connector_id=connector_id,
3094-
search_space_id=search_space_id,
3095-
user_id=user_id,
3096-
start_date=start_date,
3097-
end_date=end_date,
3098-
indexing_function=index_obsidian_vault,
3099-
update_timestamp_func=_update_connector_timestamp_by_id,
3100-
supports_heartbeat_callback=True,
3101-
)
3102-
3103-
31043032
async def run_composio_indexing_with_new_session(
31053033
connector_id: int,
31063034
search_space_id: int,

surfsense_backend/app/schemas/obsidian_auth_credentials.py

Lines changed: 0 additions & 59 deletions
This file was deleted.

surfsense_backend/app/tasks/celery_tasks/connector_tasks.py

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -883,49 +883,6 @@ async def _index_bookstack_pages(
883883
)
884884

885885

886-
@celery_app.task(name="index_obsidian_vault", bind=True)
887-
def index_obsidian_vault_task(
888-
self,
889-
connector_id: int,
890-
search_space_id: int,
891-
user_id: str,
892-
start_date: str,
893-
end_date: str,
894-
):
895-
"""Celery task to index Obsidian vault notes."""
896-
import asyncio
897-
898-
loop = asyncio.new_event_loop()
899-
asyncio.set_event_loop(loop)
900-
901-
try:
902-
loop.run_until_complete(
903-
_index_obsidian_vault(
904-
connector_id, search_space_id, user_id, start_date, end_date
905-
)
906-
)
907-
finally:
908-
loop.close()
909-
910-
911-
async def _index_obsidian_vault(
912-
connector_id: int,
913-
search_space_id: int,
914-
user_id: str,
915-
start_date: str,
916-
end_date: str,
917-
):
918-
"""Index Obsidian vault with new session."""
919-
from app.routes.search_source_connectors_routes import (
920-
run_obsidian_indexing,
921-
)
922-
923-
async with get_celery_session_maker()() as session:
924-
await run_obsidian_indexing(
925-
session, connector_id, search_space_id, user_id, start_date, end_date
926-
)
927-
928-
929886
@celery_app.task(name="index_composio_connector", bind=True)
930887
def index_composio_connector_task(
931888
self,

surfsense_backend/app/tasks/connector_indexers/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
# Documentation and knowledge management
4747
from .luma_indexer import index_luma_events
4848
from .notion_indexer import index_notion_pages
49-
from .obsidian_indexer import index_obsidian_vault
5049
from .slack_indexer import index_slack_messages
5150
from .webcrawler_indexer import index_crawled_urls
5251

@@ -69,7 +68,6 @@
6968
"index_linear_issues",
7069
# Documentation and knowledge management
7170
"index_notion_pages",
72-
"index_obsidian_vault",
7371
"index_crawled_urls",
7472
# Communication platforms
7573
"index_slack_messages",

0 commit comments

Comments
 (0)