Skip to main content

Module check

Module check 

Source
Expand description

The version check the .envrc line runs on every directory entry.

It reads one cache file per checkout and reads the network only when a refresh is due: seven days after the last success, or one hour after a failed attempt. A due refresh takes an OS file lock beside the cache first; a check that finds the lock held reads the cache it has, because another process is refreshing. It writes no file but its cache and the lock beside it, and it never moves a pin.

Structs§

Cache
One checkout’s cached answer.
Paths
The cache and its lock for one checkout.
Run
What one run of the check found.

Enums§

Outcome
What one check did.

Constants§

RETRY_INTERVAL
How long a failed attempt waits before the next one.
SUCCESS_INTERVAL
How long a success stays fresh.

Functions§

due
Whether the cache asks for a network read at now.
next_try
When the next attempt after a failure may read the network.
read
The cache at path, or None where it is absent or unreadable.
run
Run the check for one checkout: read the cache, and refresh it where a refresh is due and the lock is free.
stamp
RFC 3339 UTC to the second.
warnings
The warnings one check prints, from the cache it read, for the pin pin.