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:
Xavier Deguillard 2020-06-08 12:42:36 -07:00 committed by Facebook GitHub Bot
parent 1844b98457
commit d559d2d217

View File

@ -1253,9 +1253,6 @@ folly::Future<std::shared_ptr<EdenMount>> EdenServer::mount(
std::move(result).exception()); 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 // Now that we've started the workers, arrange to call
// mountFinished once the pool is torn down. // mountFinished once the pool is torn down.
auto finishFuture = auto finishFuture =
@ -1274,6 +1271,10 @@ folly::Future<std::shared_ptr<EdenMount>> EdenServer::mount(
return makeFuture<std::shared_ptr<EdenMount>>( return makeFuture<std::shared_ptr<EdenMount>>(
std::move(edenMount)); std::move(edenMount));
} else { } else {
#ifdef _WIN32
return makeFuture<std::shared_ptr<EdenMount>>(
std::move(edenMount));
#else
// Perform all of the bind mounts associated with the // Perform all of the bind mounts associated with the
// client. We don't need to do this for the takeover // client. We don't need to do this for the takeover
// case as they are already mounted. // case as they are already mounted.
@ -1286,11 +1287,10 @@ folly::Future<std::shared_ptr<EdenMount>> EdenServer::mount(
return edenMount; return edenMount;
}) })
.via(getServerState()->getThreadPool().get()); .via(getServerState()->getThreadPool().get());
#endif
} }
}) })
.thenTry([this, mountStopWatch, doTakeover, edenMount](auto&& t) { .thenTry([this, mountStopWatch, doTakeover, edenMount](auto&& t) {
// TODO: Include this to work on Windows when getting the event
// logging working.
FinishedMount event; FinishedMount event;
event.repo_type = edenMount->getConfig()->getRepoType(); event.repo_type = edenMount->getConfig()->getRepoType();
event.repo_source = event.repo_source =
@ -1300,10 +1300,13 @@ folly::Future<std::shared_ptr<EdenMount>> EdenServer::mount(
std::chrono::duration<double>{mountStopWatch.elapsed()} std::chrono::duration<double>{mountStopWatch.elapsed()}
.count(); .count();
event.success = !t.hasException(); event.success = !t.hasException();
#ifndef _WIN32
event.clean = edenMount->getOverlay()->hadCleanStartup(); event.clean = edenMount->getOverlay()->hadCleanStartup();
#else
event.clean = true;
#endif
serverState_->getStructuredLogger()->logEvent(event); serverState_->getStructuredLogger()->logEvent(event);
return makeFuture(std::move(t)); return makeFuture(std::move(t));
#endif
}); });
}); });
} }