diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2018-09-25 12:49:20 +0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2019-10-29 13:36:19 +0100 |
commit | 05819d013fb39eb9902d952978fff7f69e0e326e (patch) | |
tree | c9b5959d7d20fe479c630f8fa6e7b22c3168e561 /src/nix-daemon | |
parent | 63b99af85a1e280876da3d807e4bc96a5c5dde39 (diff) |
Don't create a Store in processConnection()
Diffstat (limited to 'src/nix-daemon')
-rw-r--r-- | src/nix-daemon/nix-daemon.cc | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/nix-daemon/nix-daemon.cc b/src/nix-daemon/nix-daemon.cc index 67bf4dfeb..da17ddcba 100644 --- a/src/nix-daemon/nix-daemon.cc +++ b/src/nix-daemon/nix-daemon.cc @@ -140,6 +140,15 @@ static PeerInfo getPeerInfo(int remote) #define SD_LISTEN_FDS_START 3 +static ref<Store> openUncachedStore() +{ + Store::Params params; // FIXME: get params from somewhere + // Disable caching since the client already does that. + params["path-info-cache-size"] = "0"; + return openStore(settings.storeUri, params); +} + + static void daemonLoop(char * * argv) { if (chdir("/") == -1) @@ -230,7 +239,7 @@ static void daemonLoop(char * * argv) /* Handle the connection. */ FdSource from(remote.get()); FdSink to(remote.get()); - processConnection(from, to, trusted, user, peer.uid); + processConnection(openUncachedStore(), from, to, trusted, user, peer.uid); exit(0); }, options); @@ -312,7 +321,7 @@ static int _main(int argc, char * * argv) } else { FdSource from(STDIN_FILENO); FdSink to(STDOUT_FILENO); - processConnection(from, to, true, "root", 0); + processConnection(openUncachedStore(), from, to, true, "root", 0); } } else { daemonLoop(argv); |