Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FlockExclusiveBlocking ¶
FlockExclusiveBlocking acquires an exclusive blocking lock on the file. This will wait until the lock is available.
func TryDaemonLock ¶
TryDaemonLock attempts to acquire and immediately release the daemon lock to check if a daemon is running. Returns true if daemon is running. Falls back to PID file check for backward compatibility with pre-lock daemons.
This is a cheap probe operation that should be called before attempting RPC connections to avoid unnecessary connection timeouts.
Types ¶
type LockInfo ¶
type LockInfo struct {
PID int `json:"pid"`
ParentPID int `json:"parent_pid,omitempty"`
Database string `json:"database"`
Version string `json:"version"`
StartedAt time.Time `json:"started_at"`
}
LockInfo represents the metadata stored in the daemon.lock file
func ReadLockInfo ¶
ReadLockInfo reads and parses the daemon lock file Returns lock info if available, or error if file doesn't exist or can't be parsed