mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 08:47:12 +03:00
mount: remove most of the ifdef in EdenServer::mount
Summary: The only missing piece on Windows is the bind mount/redirection due to folly::Subprocess not being present on Windows. Reviewed By: wez Differential Revision: D21676313 fbshipit-source-id: a5ba09be04c94b66edf9d40884753afa3865def2
This commit is contained in:
parent
1844b98457
commit
d559d2d217
@ -1253,9 +1253,6 @@ folly::Future<std::shared_ptr<EdenMount>> EdenServer::mount(
|
||||
std::move(result).exception());
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
return makeFuture<shared_ptr<EdenMount>>(std::move(edenMount));
|
||||
#else
|
||||
// Now that we've started the workers, arrange to call
|
||||
// mountFinished once the pool is torn down.
|
||||
auto finishFuture =
|
||||
@ -1274,6 +1271,10 @@ folly::Future<std::shared_ptr<EdenMount>> EdenServer::mount(
|
||||
return makeFuture<std::shared_ptr<EdenMount>>(
|
||||
std::move(edenMount));
|
||||
} else {
|
||||
#ifdef _WIN32
|
||||
return makeFuture<std::shared_ptr<EdenMount>>(
|
||||
std::move(edenMount));
|
||||
#else
|
||||
// Perform all of the bind mounts associated with the
|
||||
// client. We don't need to do this for the takeover
|
||||
// case as they are already mounted.
|
||||
@ -1286,11 +1287,10 @@ folly::Future<std::shared_ptr<EdenMount>> EdenServer::mount(
|
||||
return edenMount;
|
||||
})
|
||||
.via(getServerState()->getThreadPool().get());
|
||||
#endif
|
||||
}
|
||||
})
|
||||
.thenTry([this, mountStopWatch, doTakeover, edenMount](auto&& t) {
|
||||
// TODO: Include this to work on Windows when getting the event
|
||||
// logging working.
|
||||
FinishedMount event;
|
||||
event.repo_type = edenMount->getConfig()->getRepoType();
|
||||
event.repo_source =
|
||||
@ -1300,10 +1300,13 @@ folly::Future<std::shared_ptr<EdenMount>> EdenServer::mount(
|
||||
std::chrono::duration<double>{mountStopWatch.elapsed()}
|
||||
.count();
|
||||
event.success = !t.hasException();
|
||||
#ifndef _WIN32
|
||||
event.clean = edenMount->getOverlay()->hadCleanStartup();
|
||||
#else
|
||||
event.clean = true;
|
||||
#endif
|
||||
serverState_->getStructuredLogger()->logEvent(event);
|
||||
return makeFuture(std::move(t));
|
||||
#endif
|
||||
});
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user