kodit 0.4.3__py3-none-any.whl → 0.5.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of kodit might be problematic. Click here for more details.
- kodit/_version.py +2 -2
- kodit/app.py +51 -23
- kodit/application/factories/reporting_factory.py +6 -2
- kodit/application/factories/server_factory.py +353 -0
- kodit/application/services/code_search_application_service.py +144 -0
- kodit/application/services/commit_indexing_application_service.py +700 -0
- kodit/application/services/indexing_worker_service.py +13 -44
- kodit/application/services/queue_service.py +24 -3
- kodit/application/services/reporting.py +0 -2
- kodit/application/services/sync_scheduler.py +15 -31
- kodit/cli.py +2 -753
- kodit/cli_utils.py +2 -9
- kodit/config.py +4 -97
- kodit/database.py +38 -1
- kodit/domain/enrichments/__init__.py +1 -0
- kodit/domain/enrichments/architecture/__init__.py +1 -0
- kodit/domain/enrichments/architecture/architecture.py +20 -0
- kodit/domain/enrichments/architecture/physical/__init__.py +1 -0
- kodit/domain/enrichments/architecture/physical/discovery_notes.py +14 -0
- kodit/domain/enrichments/architecture/physical/formatter.py +11 -0
- kodit/domain/enrichments/architecture/physical/physical.py +17 -0
- kodit/domain/enrichments/development/__init__.py +1 -0
- kodit/domain/enrichments/development/development.py +18 -0
- kodit/domain/enrichments/development/snippet/__init__.py +1 -0
- kodit/domain/enrichments/development/snippet/snippet.py +21 -0
- kodit/domain/enrichments/enricher.py +17 -0
- kodit/domain/enrichments/enrichment.py +39 -0
- kodit/domain/enrichments/request.py +12 -0
- kodit/domain/enrichments/response.py +11 -0
- kodit/domain/enrichments/usage/__init__.py +1 -0
- kodit/domain/enrichments/usage/api_docs.py +19 -0
- kodit/domain/enrichments/usage/usage.py +18 -0
- kodit/domain/{entities.py → entities/__init__.py} +50 -195
- kodit/domain/entities/git.py +190 -0
- kodit/domain/factories/__init__.py +1 -0
- kodit/domain/factories/git_repo_factory.py +76 -0
- kodit/domain/protocols.py +264 -64
- kodit/domain/services/bm25_service.py +5 -1
- kodit/domain/services/embedding_service.py +3 -0
- kodit/domain/services/enrichment_service.py +9 -30
- kodit/domain/services/git_repository_service.py +429 -0
- kodit/domain/services/git_service.py +300 -0
- kodit/domain/services/physical_architecture_service.py +182 -0
- kodit/domain/services/task_status_query_service.py +2 -2
- kodit/domain/value_objects.py +87 -135
- kodit/infrastructure/api/client/__init__.py +0 -2
- kodit/infrastructure/api/v1/__init__.py +0 -4
- kodit/infrastructure/api/v1/dependencies.py +92 -46
- kodit/infrastructure/api/v1/routers/__init__.py +0 -6
- kodit/infrastructure/api/v1/routers/commits.py +352 -0
- kodit/infrastructure/api/v1/routers/queue.py +2 -2
- kodit/infrastructure/api/v1/routers/repositories.py +282 -0
- kodit/infrastructure/api/v1/routers/search.py +31 -14
- kodit/infrastructure/api/v1/schemas/__init__.py +0 -24
- kodit/infrastructure/api/v1/schemas/commit.py +96 -0
- kodit/infrastructure/api/v1/schemas/context.py +2 -0
- kodit/infrastructure/api/v1/schemas/enrichment.py +29 -0
- kodit/infrastructure/api/v1/schemas/repository.py +128 -0
- kodit/infrastructure/api/v1/schemas/search.py +12 -9
- kodit/infrastructure/api/v1/schemas/snippet.py +58 -0
- kodit/infrastructure/api/v1/schemas/tag.py +31 -0
- kodit/infrastructure/api/v1/schemas/task_status.py +2 -0
- kodit/infrastructure/bm25/local_bm25_repository.py +16 -4
- kodit/infrastructure/bm25/vectorchord_bm25_repository.py +68 -52
- kodit/infrastructure/cloning/git/git_python_adaptor.py +534 -0
- kodit/infrastructure/cloning/git/working_copy.py +1 -1
- kodit/infrastructure/embedding/embedding_factory.py +3 -2
- kodit/infrastructure/embedding/local_vector_search_repository.py +1 -1
- kodit/infrastructure/embedding/vectorchord_vector_search_repository.py +111 -84
- kodit/infrastructure/enricher/__init__.py +1 -0
- kodit/infrastructure/enricher/enricher_factory.py +53 -0
- kodit/infrastructure/{enrichment/litellm_enrichment_provider.py → enricher/litellm_enricher.py} +36 -56
- kodit/infrastructure/{enrichment/local_enrichment_provider.py → enricher/local_enricher.py} +19 -24
- kodit/infrastructure/enricher/null_enricher.py +36 -0
- kodit/infrastructure/indexing/fusion_service.py +1 -1
- kodit/infrastructure/mappers/enrichment_mapper.py +83 -0
- kodit/infrastructure/mappers/git_mapper.py +193 -0
- kodit/infrastructure/mappers/snippet_mapper.py +104 -0
- kodit/infrastructure/mappers/task_mapper.py +5 -44
- kodit/infrastructure/physical_architecture/__init__.py +1 -0
- kodit/infrastructure/physical_architecture/detectors/__init__.py +1 -0
- kodit/infrastructure/physical_architecture/detectors/docker_compose_detector.py +336 -0
- kodit/infrastructure/physical_architecture/formatters/__init__.py +1 -0
- kodit/infrastructure/physical_architecture/formatters/narrative_formatter.py +149 -0
- kodit/infrastructure/reporting/log_progress.py +8 -5
- kodit/infrastructure/reporting/telemetry_progress.py +21 -0
- kodit/infrastructure/slicing/api_doc_extractor.py +836 -0
- kodit/infrastructure/slicing/ast_analyzer.py +1128 -0
- kodit/infrastructure/slicing/slicer.py +87 -421
- kodit/infrastructure/sqlalchemy/embedding_repository.py +43 -23
- kodit/infrastructure/sqlalchemy/enrichment_v2_repository.py +118 -0
- kodit/infrastructure/sqlalchemy/entities.py +402 -158
- kodit/infrastructure/sqlalchemy/git_branch_repository.py +274 -0
- kodit/infrastructure/sqlalchemy/git_commit_repository.py +346 -0
- kodit/infrastructure/sqlalchemy/git_repository.py +262 -0
- kodit/infrastructure/sqlalchemy/git_tag_repository.py +268 -0
- kodit/infrastructure/sqlalchemy/snippet_v2_repository.py +479 -0
- kodit/infrastructure/sqlalchemy/task_repository.py +29 -23
- kodit/infrastructure/sqlalchemy/task_status_repository.py +24 -12
- kodit/infrastructure/sqlalchemy/unit_of_work.py +10 -14
- kodit/mcp.py +12 -30
- kodit/migrations/env.py +1 -0
- kodit/migrations/versions/04b80f802e0c_foreign_key_review.py +100 -0
- kodit/migrations/versions/19f8c7faf8b9_add_generic_enrichment_type.py +260 -0
- kodit/migrations/versions/7f15f878c3a1_add_new_git_entities.py +690 -0
- kodit/migrations/versions/f9e5ef5e688f_add_git_commits_number.py +43 -0
- kodit/py.typed +0 -0
- kodit/utils/dump_config.py +361 -0
- kodit/utils/dump_openapi.py +6 -4
- kodit/utils/path_utils.py +29 -0
- {kodit-0.4.3.dist-info → kodit-0.5.1.dist-info}/METADATA +3 -3
- kodit-0.5.1.dist-info/RECORD +168 -0
- kodit/application/factories/code_indexing_factory.py +0 -195
- kodit/application/services/auto_indexing_service.py +0 -99
- kodit/application/services/code_indexing_application_service.py +0 -410
- kodit/domain/services/index_query_service.py +0 -70
- kodit/domain/services/index_service.py +0 -269
- kodit/infrastructure/api/client/index_client.py +0 -57
- kodit/infrastructure/api/v1/routers/indexes.py +0 -164
- kodit/infrastructure/api/v1/schemas/index.py +0 -101
- kodit/infrastructure/bm25/bm25_factory.py +0 -28
- kodit/infrastructure/cloning/__init__.py +0 -1
- kodit/infrastructure/cloning/metadata.py +0 -98
- kodit/infrastructure/enrichment/__init__.py +0 -1
- kodit/infrastructure/enrichment/enrichment_factory.py +0 -52
- kodit/infrastructure/enrichment/null_enrichment_provider.py +0 -19
- kodit/infrastructure/mappers/index_mapper.py +0 -345
- kodit/infrastructure/reporting/tdqm_progress.py +0 -38
- kodit/infrastructure/slicing/language_detection_service.py +0 -18
- kodit/infrastructure/sqlalchemy/index_repository.py +0 -646
- kodit-0.4.3.dist-info/RECORD +0 -125
- /kodit/infrastructure/{enrichment → enricher}/utils.py +0 -0
- {kodit-0.4.3.dist-info → kodit-0.5.1.dist-info}/WHEEL +0 -0
- {kodit-0.4.3.dist-info → kodit-0.5.1.dist-info}/entry_points.txt +0 -0
- {kodit-0.4.3.dist-info → kodit-0.5.1.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
"""Factory for creating the unified code indexing application service."""
|
|
2
|
-
|
|
3
|
-
from collections.abc import Callable
|
|
4
|
-
|
|
5
|
-
from sqlalchemy.ext.asyncio import AsyncSession
|
|
6
|
-
|
|
7
|
-
from kodit.application.factories.reporting_factory import (
|
|
8
|
-
create_cli_operation,
|
|
9
|
-
create_noop_operation,
|
|
10
|
-
create_server_operation,
|
|
11
|
-
)
|
|
12
|
-
from kodit.application.services.code_indexing_application_service import (
|
|
13
|
-
CodeIndexingApplicationService,
|
|
14
|
-
)
|
|
15
|
-
from kodit.application.services.reporting import (
|
|
16
|
-
ProgressTracker,
|
|
17
|
-
)
|
|
18
|
-
from kodit.config import AppContext
|
|
19
|
-
from kodit.domain.services.bm25_service import BM25DomainService
|
|
20
|
-
from kodit.domain.services.embedding_service import EmbeddingDomainService
|
|
21
|
-
from kodit.domain.services.enrichment_service import EnrichmentDomainService
|
|
22
|
-
from kodit.domain.services.index_query_service import IndexQueryService
|
|
23
|
-
from kodit.domain.services.index_service import (
|
|
24
|
-
IndexDomainService,
|
|
25
|
-
)
|
|
26
|
-
from kodit.domain.value_objects import LanguageMapping
|
|
27
|
-
from kodit.infrastructure.bm25.bm25_factory import bm25_repository_factory
|
|
28
|
-
from kodit.infrastructure.embedding.embedding_factory import (
|
|
29
|
-
embedding_domain_service_factory,
|
|
30
|
-
)
|
|
31
|
-
from kodit.infrastructure.embedding.embedding_providers.hash_embedding_provider import (
|
|
32
|
-
HashEmbeddingProvider,
|
|
33
|
-
)
|
|
34
|
-
from kodit.infrastructure.embedding.local_vector_search_repository import (
|
|
35
|
-
LocalVectorSearchRepository,
|
|
36
|
-
)
|
|
37
|
-
from kodit.infrastructure.enrichment.enrichment_factory import (
|
|
38
|
-
enrichment_domain_service_factory,
|
|
39
|
-
)
|
|
40
|
-
from kodit.infrastructure.enrichment.null_enrichment_provider import (
|
|
41
|
-
NullEnrichmentProvider,
|
|
42
|
-
)
|
|
43
|
-
from kodit.infrastructure.indexing.fusion_service import ReciprocalRankFusionService
|
|
44
|
-
from kodit.infrastructure.slicing.language_detection_service import (
|
|
45
|
-
FileSystemLanguageDetectionService,
|
|
46
|
-
)
|
|
47
|
-
from kodit.infrastructure.sqlalchemy.embedding_repository import (
|
|
48
|
-
create_embedding_repository,
|
|
49
|
-
)
|
|
50
|
-
from kodit.infrastructure.sqlalchemy.entities import EmbeddingType
|
|
51
|
-
from kodit.infrastructure.sqlalchemy.index_repository import (
|
|
52
|
-
create_index_repository,
|
|
53
|
-
)
|
|
54
|
-
from kodit.infrastructure.sqlalchemy.task_status_repository import (
|
|
55
|
-
create_task_status_repository,
|
|
56
|
-
)
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
def create_code_indexing_application_service(
|
|
60
|
-
app_context: AppContext,
|
|
61
|
-
session_factory: Callable[[], AsyncSession],
|
|
62
|
-
operation: ProgressTracker,
|
|
63
|
-
) -> CodeIndexingApplicationService:
|
|
64
|
-
"""Create a unified code indexing application service with all dependencies."""
|
|
65
|
-
# Create domain services
|
|
66
|
-
bm25_service = BM25DomainService(
|
|
67
|
-
bm25_repository_factory(app_context, session_factory())
|
|
68
|
-
)
|
|
69
|
-
code_search_service = embedding_domain_service_factory(
|
|
70
|
-
"code", app_context, session_factory(), session_factory
|
|
71
|
-
)
|
|
72
|
-
text_search_service = embedding_domain_service_factory(
|
|
73
|
-
"text", app_context, session_factory(), session_factory
|
|
74
|
-
)
|
|
75
|
-
enrichment_service = enrichment_domain_service_factory(app_context)
|
|
76
|
-
index_repository = create_index_repository(session_factory=session_factory)
|
|
77
|
-
# Use the unified language mapping from the domain layer
|
|
78
|
-
language_map = LanguageMapping.get_extension_to_language_map()
|
|
79
|
-
|
|
80
|
-
# Create infrastructure services
|
|
81
|
-
language_detector = FileSystemLanguageDetectionService(language_map)
|
|
82
|
-
|
|
83
|
-
index_domain_service = IndexDomainService(
|
|
84
|
-
language_detector=language_detector,
|
|
85
|
-
enrichment_service=enrichment_service,
|
|
86
|
-
clone_dir=app_context.get_clone_dir(),
|
|
87
|
-
)
|
|
88
|
-
index_query_service = IndexQueryService(
|
|
89
|
-
index_repository=index_repository,
|
|
90
|
-
fusion_service=ReciprocalRankFusionService(),
|
|
91
|
-
)
|
|
92
|
-
|
|
93
|
-
# Create and return the unified application service
|
|
94
|
-
return CodeIndexingApplicationService(
|
|
95
|
-
indexing_domain_service=index_domain_service,
|
|
96
|
-
index_repository=index_repository,
|
|
97
|
-
index_query_service=index_query_service,
|
|
98
|
-
bm25_service=bm25_service,
|
|
99
|
-
code_search_service=code_search_service,
|
|
100
|
-
text_search_service=text_search_service,
|
|
101
|
-
enrichment_service=enrichment_service,
|
|
102
|
-
operation=operation,
|
|
103
|
-
)
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
def create_cli_code_indexing_application_service(
|
|
107
|
-
app_context: AppContext,
|
|
108
|
-
session_factory: Callable[[], AsyncSession],
|
|
109
|
-
) -> CodeIndexingApplicationService:
|
|
110
|
-
"""Create a CLI code indexing application service."""
|
|
111
|
-
return create_code_indexing_application_service(
|
|
112
|
-
app_context,
|
|
113
|
-
session_factory,
|
|
114
|
-
create_cli_operation(),
|
|
115
|
-
)
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
def create_server_code_indexing_application_service(
|
|
119
|
-
app_context: AppContext,
|
|
120
|
-
session_factory: Callable[[], AsyncSession],
|
|
121
|
-
) -> CodeIndexingApplicationService:
|
|
122
|
-
"""Create a server code indexing application service."""
|
|
123
|
-
return create_code_indexing_application_service(
|
|
124
|
-
app_context,
|
|
125
|
-
session_factory,
|
|
126
|
-
create_server_operation(create_task_status_repository(session_factory)),
|
|
127
|
-
)
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
def create_fast_test_code_indexing_application_service(
|
|
131
|
-
app_context: AppContext,
|
|
132
|
-
session_factory: Callable[[], AsyncSession],
|
|
133
|
-
) -> CodeIndexingApplicationService:
|
|
134
|
-
"""Create a fast test code indexing application service."""
|
|
135
|
-
# Create domain services
|
|
136
|
-
bm25_service = BM25DomainService(
|
|
137
|
-
bm25_repository_factory(app_context, session_factory())
|
|
138
|
-
)
|
|
139
|
-
embedding_repository = create_embedding_repository(session_factory=session_factory)
|
|
140
|
-
operation = create_noop_operation()
|
|
141
|
-
|
|
142
|
-
code_search_repository = LocalVectorSearchRepository(
|
|
143
|
-
embedding_repository=embedding_repository,
|
|
144
|
-
embedding_provider=HashEmbeddingProvider(),
|
|
145
|
-
embedding_type=EmbeddingType.CODE,
|
|
146
|
-
)
|
|
147
|
-
code_search_service = EmbeddingDomainService(
|
|
148
|
-
embedding_provider=HashEmbeddingProvider(),
|
|
149
|
-
vector_search_repository=code_search_repository,
|
|
150
|
-
)
|
|
151
|
-
|
|
152
|
-
# Fast text search service
|
|
153
|
-
text_search_repository = LocalVectorSearchRepository(
|
|
154
|
-
embedding_repository=embedding_repository,
|
|
155
|
-
embedding_provider=HashEmbeddingProvider(),
|
|
156
|
-
embedding_type=EmbeddingType.TEXT,
|
|
157
|
-
)
|
|
158
|
-
text_search_service = EmbeddingDomainService(
|
|
159
|
-
embedding_provider=HashEmbeddingProvider(),
|
|
160
|
-
vector_search_repository=text_search_repository,
|
|
161
|
-
)
|
|
162
|
-
|
|
163
|
-
# Fast enrichment service using NullEnrichmentProvider
|
|
164
|
-
enrichment_service = EnrichmentDomainService(
|
|
165
|
-
enrichment_provider=NullEnrichmentProvider()
|
|
166
|
-
)
|
|
167
|
-
|
|
168
|
-
index_repository = create_index_repository(session_factory=session_factory)
|
|
169
|
-
# Use the unified language mapping from the domain layer
|
|
170
|
-
language_map = LanguageMapping.get_extension_to_language_map()
|
|
171
|
-
|
|
172
|
-
# Create infrastructure services
|
|
173
|
-
language_detector = FileSystemLanguageDetectionService(language_map)
|
|
174
|
-
|
|
175
|
-
index_domain_service = IndexDomainService(
|
|
176
|
-
language_detector=language_detector,
|
|
177
|
-
enrichment_service=enrichment_service,
|
|
178
|
-
clone_dir=app_context.get_clone_dir(),
|
|
179
|
-
)
|
|
180
|
-
index_query_service = IndexQueryService(
|
|
181
|
-
index_repository=index_repository,
|
|
182
|
-
fusion_service=ReciprocalRankFusionService(),
|
|
183
|
-
)
|
|
184
|
-
|
|
185
|
-
# Create and return the unified application service
|
|
186
|
-
return CodeIndexingApplicationService(
|
|
187
|
-
indexing_domain_service=index_domain_service,
|
|
188
|
-
index_repository=index_repository,
|
|
189
|
-
index_query_service=index_query_service,
|
|
190
|
-
bm25_service=bm25_service,
|
|
191
|
-
code_search_service=code_search_service,
|
|
192
|
-
text_search_service=text_search_service,
|
|
193
|
-
enrichment_service=enrichment_service,
|
|
194
|
-
operation=operation,
|
|
195
|
-
)
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
"""Service for automatically indexing configured sources."""
|
|
2
|
-
|
|
3
|
-
import asyncio
|
|
4
|
-
import warnings
|
|
5
|
-
from collections.abc import Callable
|
|
6
|
-
from contextlib import suppress
|
|
7
|
-
|
|
8
|
-
import structlog
|
|
9
|
-
from sqlalchemy.ext.asyncio import AsyncSession
|
|
10
|
-
|
|
11
|
-
from kodit.application.factories.code_indexing_factory import (
|
|
12
|
-
create_code_indexing_application_service,
|
|
13
|
-
)
|
|
14
|
-
from kodit.application.factories.reporting_factory import create_noop_operation
|
|
15
|
-
from kodit.application.services.queue_service import QueueService
|
|
16
|
-
from kodit.application.services.reporting import ProgressTracker
|
|
17
|
-
from kodit.config import AppContext
|
|
18
|
-
from kodit.domain.entities import Task
|
|
19
|
-
from kodit.domain.value_objects import QueuePriority
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
class AutoIndexingService:
|
|
23
|
-
"""Service for automatically indexing configured sources."""
|
|
24
|
-
|
|
25
|
-
def __init__(
|
|
26
|
-
self,
|
|
27
|
-
app_context: AppContext,
|
|
28
|
-
session_factory: Callable[[], AsyncSession],
|
|
29
|
-
) -> None:
|
|
30
|
-
"""Initialize the auto-indexing service."""
|
|
31
|
-
self.app_context = app_context
|
|
32
|
-
self.session_factory = session_factory
|
|
33
|
-
self.log = structlog.get_logger(__name__)
|
|
34
|
-
self._indexing_task: asyncio.Task | None = None
|
|
35
|
-
|
|
36
|
-
async def start_background_indexing(
|
|
37
|
-
self, operation: ProgressTracker | None = None
|
|
38
|
-
) -> None:
|
|
39
|
-
"""Start background indexing of configured sources."""
|
|
40
|
-
operation = operation or create_noop_operation()
|
|
41
|
-
if (
|
|
42
|
-
not self.app_context.auto_indexing
|
|
43
|
-
or len(self.app_context.auto_indexing.sources) == 0
|
|
44
|
-
):
|
|
45
|
-
self.log.info("Auto-indexing is disabled (no sources configured)")
|
|
46
|
-
return
|
|
47
|
-
|
|
48
|
-
warnings.warn(
|
|
49
|
-
"Auto-indexing is deprecated and will be removed in a future version, please use the API to index sources.", # noqa: E501
|
|
50
|
-
DeprecationWarning,
|
|
51
|
-
stacklevel=2,
|
|
52
|
-
)
|
|
53
|
-
|
|
54
|
-
auto_sources = [source.uri for source in self.app_context.auto_indexing.sources]
|
|
55
|
-
self.log.info("Starting background indexing", num_sources=len(auto_sources))
|
|
56
|
-
self._indexing_task = asyncio.create_task(
|
|
57
|
-
self._index_sources(auto_sources, operation)
|
|
58
|
-
)
|
|
59
|
-
|
|
60
|
-
async def _index_sources(
|
|
61
|
-
self, sources: list[str], operation: ProgressTracker | None = None
|
|
62
|
-
) -> None:
|
|
63
|
-
"""Index all configured sources in the background."""
|
|
64
|
-
operation = operation or create_noop_operation()
|
|
65
|
-
queue_service = QueueService(session_factory=self.session_factory)
|
|
66
|
-
service = create_code_indexing_application_service(
|
|
67
|
-
app_context=self.app_context,
|
|
68
|
-
session_factory=self.session_factory,
|
|
69
|
-
operation=operation,
|
|
70
|
-
)
|
|
71
|
-
|
|
72
|
-
for source in sources:
|
|
73
|
-
try:
|
|
74
|
-
# Only auto-index a source if it is new
|
|
75
|
-
if await service.does_index_exist(source):
|
|
76
|
-
self.log.info("Index already exists, skipping", source=source)
|
|
77
|
-
continue
|
|
78
|
-
|
|
79
|
-
self.log.info("Adding auto-indexing task to queue", source=source)
|
|
80
|
-
|
|
81
|
-
# Create index
|
|
82
|
-
index = await service.create_index_from_uri(source)
|
|
83
|
-
|
|
84
|
-
await queue_service.enqueue_task(
|
|
85
|
-
Task.create_index_update_task(index.id, QueuePriority.BACKGROUND)
|
|
86
|
-
)
|
|
87
|
-
|
|
88
|
-
except Exception as exc:
|
|
89
|
-
self.log.exception(
|
|
90
|
-
"Failed to auto-index source", source=source, error=str(exc)
|
|
91
|
-
)
|
|
92
|
-
# Continue with other sources even if one fails
|
|
93
|
-
|
|
94
|
-
async def stop(self) -> None:
|
|
95
|
-
"""Stop background indexing."""
|
|
96
|
-
if self._indexing_task:
|
|
97
|
-
self._indexing_task.cancel()
|
|
98
|
-
with suppress(asyncio.CancelledError):
|
|
99
|
-
await self._indexing_task
|