Expand description
A saved copy of an integration’s repository list, so the Clone dialog shows it at once while a fresh request runs.
One JSON file per key (integration id, host, login) in a cache
directory the caller names. Read leniently: a missing, corrupt, foreign
version or colliding-name file is no cache. Writes go through a temp file
and a rename. Never holds a token: the key is the profile id, the host and
the connected login, so another account on the same profile is another
entry.
Structs§
- Cached
List - One saved list.
- ListKey
- What a saved list belongs to.
Constants§
- MAX_
DESCRIPTION - Stored descriptions are cut to this many characters.
- MAX_
FILES prunekeeps at most this many files, newest first.- MAX_
PROJECTS - A list longer than this is cut when stored (bounds a file to a few MB).
- VERSION
- File format version; any other value reads as no cache.
Functions§
- load
- The saved list of
key, orNonewhen absent or unreadable. - prune
- Deletes every file whose key is not in
live(a removed profile, a disconnected or other account), then keeps only theMAX_FILESnewest. Files that do not parse are deleted too. - remove
- Deletes the saved list of
key. - remove_
integration - Deletes every saved list of the integration
id, whatever its host and login; returns how many files went. Files that do not parse are left toprune. - store
- Saves
list(temp file, then rename), capped and stripped of user info.