Skip to main content

job_singleton_path

Function job_singleton_path 

Source
pub fn job_singleton_path(
    job_type: JobType,
    namespace: &str,
    db_hash: &str,
) -> Result<PathBuf, AppError>
Expand description

Returns the singleton lock file path for a given (job_type, namespace, db_hash).

Layout: job-singleton-{tag}-{namespace_slug}-{db_hash}.lock in the same cache dir as the CLI slots. The namespace is sanitised to a filesystem-safe slug (lowercase, hyphens, alphanumeric) and defaults to default when empty. The db_hash is the BLAKE3 prefix returned by db_path_hash.

G30 (v1.0.69): the previous implementation ignored the database path entirely, so two concurrent enrich invocations against different graphrag.sqlite files (production vs. test) collided on the same cache-dir lock. The db_hash scope makes the singleton per-database while still sharing the same cache dir.