Coverage for src / qdrant_loader / core / worker / job_types.py: 89%

9 statements  

« prev     ^ index     » next       coverage.py v7.13.5, created at 2026-06-11 09:38 +0000

1"""Job type constants for worker queue operations. 

2 

3Consolidates all ingestion job types to prevent typo drift and enable 

4type-safe job handling across the codebase. 

5""" 

6 

7from enum import StrEnum 

8 

9 

10class JobType(StrEnum): 

11 """Enumeration of all supported job types in the worker queue. 

12 

13 Usage: 

14 - Batch jobs: BULK_INGEST, INCREMENTAL_PULL, CLUSTER_RECOMPUTE 

15 - Single-document operations: SINGLE_UPSERT, SINGLE_DELETE 

16 """ 

17 

18 # Batch operations (scheduler + admin trigger) 

19 BULK_INGEST = "BULK_INGEST" 

20 INCREMENTAL_PULL = "INCREMENTAL_PULL" 

21 CLUSTER_RECOMPUTE = "CLUSTER_RECOMPUTE" 

22 

23 # Single-document operations (webhooks) 

24 SINGLE_UPSERT = "SINGLE_UPSERT" 

25 SINGLE_DELETE = "SINGLE_DELETE" 

26 

27 def __str__(self) -> str: 

28 """Return the string value of the enum member.""" 

29 return self.value