Replace hasSubstitutes() with querySubstitutablePaths()
querySubstitutablePaths() takes a set of paths, so this greatly reduces daemon <-> client latency.
This commit is contained in:
parent
58ef4d9a95
commit
09a6321aeb
8 changed files with 52 additions and 24 deletions
|
|
@ -309,12 +309,21 @@ static void performOp(unsigned int clientVersion,
|
|||
case wopHasSubstitutes: {
|
||||
Path path = readStorePath(from);
|
||||
startWork();
|
||||
bool result = store->hasSubstitutes(path);
|
||||
PathSet res = store->querySubstitutablePaths(singleton<PathSet>(path));
|
||||
stopWork();
|
||||
writeInt(result, to);
|
||||
writeInt(res.find(path) != res.end(), to);
|
||||
break;
|
||||
}
|
||||
|
||||
case wopQuerySubstitutablePaths: {
|
||||
PathSet paths = readStorePaths<PathSet>(from);
|
||||
startWork();
|
||||
PathSet res = store->querySubstitutablePaths(paths);
|
||||
stopWork();
|
||||
writeStrings(res, to);
|
||||
break;
|
||||
}
|
||||
|
||||
case wopQueryPathHash: {
|
||||
Path path = readStorePath(from);
|
||||
startWork();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue