feat(server): Reimplement local manifest cache backed by files

Implements a local manifest cache that uses the temporary directory to
cache manifest builds.

This is necessary due to the size of manifests: Keeping them entirely
in-memory would quickly balloon the memory usage of Nixery, unless
some mechanism for cache eviction is implemented.
This commit is contained in:
Vincent Ambo 2019-10-03 12:49:26 +01:00 committed by Vincent Ambo
parent 313e5d08f1
commit 43a642435b
5 changed files with 71 additions and 52 deletions

View file

@ -71,13 +71,13 @@ type Config struct {
PopUrl string // URL to the Nix package popularity count
}
func FromEnv() (*Config, error) {
func FromEnv() (Config, error) {
pkgs, err := pkgSourceFromEnv()
if err != nil {
return nil, err
return Config{}, err
}
return &Config{
return Config{
Bucket: getConfig("BUCKET", "GCS bucket for layer storage", ""),
Port: getConfig("PORT", "HTTP port", ""),
Pkgs: pkgs,