Skip to main content

Module constants

Module constants 

Source
Expand description

Central constants for codesearch configuration

All string literals for paths, filenames, and configuration should be defined here to avoid duplication and ensure consistency across the codebase.

Constants§

ALWAYS_EXCLUDED
Directories and files that should always be excluded from indexing These are added to both .gitignore and .codesearchignore automatically
CONFIG_DIR_NAME
Name of the global config directory in user home
DB_DIR_NAME
Name of the database directory in project roots
DEFAULT_CACHE_MAX_MEMORY_MB
Default embedding cache memory limit in MB.
DEFAULT_FSW_DEBOUNCE_MS
File watcher debounce time in milliseconds
DEFAULT_LMDB_MAP_SIZE_MB
Default LMDB map size in megabytes (256MB).
DEFAULT_LOG_MAX_FILES
Default number of log files to retain
DEFAULT_LOG_RETENTION_DAYS
Default log retention period in days
FILE_META_DB_NAME
Name of the file metadata database
LOG_DIR_NAME
Log directory name within .codesearch.db
LOG_FILE_NAME
Default log file name
REPOS_CONFIG_FILE
Name of the repos configuration file
WRITER_LOCK_FILE
Lock file name to indicate an active writer instance This prevents multiple processes from writing to the same database

Statics§

SHUTDOWN_REQUESTED
Global shutdown flag, set by the CTRL-C handler.

Functions§

check_shutdown
Check whether a graceful shutdown has been requested via either the global AtomicBool (OS signal) or a CancellationToken.
get_global_models_cache_dir
Get the global models cache directory (~/.codesearch/models/).
is_shutdown_requested
Check whether a graceful shutdown has been requested (CTRL-C).