From cd4d2705ec6e641ffa3b11dc1aabad22fc38251a Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 2 May 2017 14:18:46 +0200 Subject: build-remote: Fix fallback to other machines when connecting fails Opening an SSHStore or LegacySSHStore does not actually establish a connection, so the try/catch block here did nothing. Added a Store::connect() method to test whether a connection can be established. --- src/libstore/store-api.hh | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/libstore/store-api.hh') diff --git a/src/libstore/store-api.hh b/src/libstore/store-api.hh index 8ca3f4b27d06..b06f5d86a93a 100644 --- a/src/libstore/store-api.hh +++ b/src/libstore/store-api.hh @@ -582,6 +582,10 @@ public: state.lock()->pathInfoCache.clear(); } + /* Establish a connection to the store, for store types that have + a notion of connection. Otherwise this is a no-op. */ + virtual void connect() { }; + protected: Stats stats; -- cgit 1.4.1