Skip to content

Git cache: serve cached repositories offline #728

Open

Description

@simonchrz

Follow-up to #403 (step 5 of the plan there).

A cached Git repository is served without the upstream only while its last successful check is younger than git.stale_max_age (24h by default). After that a clone fails, although the repository is on disk. That is right for a proxy in front of a reachable forge, but not for a site that is cut off on purpose, or for an outage that lasts longer than stale_max_age.

An offline mode would serve what the cache holds without contacting the upstream:

  • per upstream or for the whole git cache, e.g. git.offline: true
  • no ref check and no fetch; branches and tags as last fetched
  • a commit the cache doesn't have fails at once instead of waiting on the upstream
  • the UI and the log say a repository was served offline, and how old its copy is

Open questions: whether this is a config switch only or can also be turned on at runtime, and whether it should also cover the background refresh from #706 (which would simply not run).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions