Skip to main content

Module limits

Module limits 

Source
Expand description

Resource limit detection and threshold checking for large repos.

This module provides platform-specific detection of file watching limits and generates warnings when thresholds are exceeded.

Structs§

DiffMetrics
Metrics collected during diff computation.
DiffThresholds
Thresholds for diff processing warnings.
WatcherMetrics
Metrics collected during file watcher setup. Only meaningful on Linux where we watch directories individually.

Functions§

check_watch_warning
Check if watch metrics exceed thresholds and return a warning message. On macOS/Windows with recursive watching, this is never called.
get_watch_limit
Get the recommended watch limit for Linux. Uses 50% of the inotify limit since it’s shared across all user applications. Returns None on WSL (which uses PollWatcher with no limit).
is_wsl
Detect if running under Windows Subsystem for Linux. WSL’s inotify implementation is unreliable, so we use polling instead.
parse_inotify_value
Parse an inotify sysctl value from its string representation. Returns None if the string is empty or not a valid number.