aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/zenserver/main.cpp')
-rw-r--r--src/zenserver/main.cpp46
1 files changed, 43 insertions, 3 deletions
diff --git a/src/zenserver/main.cpp b/src/zenserver/main.cpp
index 00b7a67d7..d74d3956c 100644
--- a/src/zenserver/main.cpp
+++ b/src/zenserver/main.cpp
@@ -14,13 +14,13 @@
#include <zencore/memory/memorytrace.h>
#include <zencore/memory/newdelete.h>
#include <zencore/scopeguard.h>
-#include <zencore/sentryintegration.h>
#include <zencore/session.h>
#include <zencore/string.h>
#include <zencore/thread.h>
#include <zencore/trace.h>
#include <zentelemetry/otlptrace.h>
#include <zenutil/config/commandlineoptions.h>
+#include <zenutil/invocationhistory.h>
#include <zenutil/service.h>
#include "diag/logging.h"
@@ -169,7 +169,12 @@ AppMain(int argc, char* argv[])
if (IsDir(ServerOptions.DataDir))
{
ZEN_CONSOLE_INFO("Deleting files from '{}' ({})", ServerOptions.DataDir, DeleteReason);
- DeleteDirectories(ServerOptions.DataDir);
+ std::error_code Ec;
+ DeleteDirectories(ServerOptions.DataDir, Ec);
+ if (Ec)
+ {
+ ZEN_WARN("could not fully clean '{}': {} (continuing anyway)", ServerOptions.DataDir, Ec.message());
+ }
}
}
@@ -250,7 +255,7 @@ test_main(int argc, char** argv)
zen::MaximizeOpenFileCount();
zen::testing::TestRunner Runner;
- Runner.ApplyCommandLine(argc, argv);
+ Runner.ApplyCommandLine(argc, argv, "server.*");
return Runner.Run();
}
#endif
@@ -260,6 +265,41 @@ main(int argc, char* argv[])
{
zen::InstallCrashHandler();
+ {
+ std::string_view ModeStr = "store";
+ if (argc >= 2 && argv[1] != nullptr)
+ {
+ std::string_view A1 = argv[1];
+ if (!A1.empty() && A1[0] != '-')
+ {
+ if (A1 == "hub")
+ {
+ ModeStr = "hub";
+ }
+ else if (A1 == "store" || A1 == "storage")
+ {
+ ModeStr = "store";
+ }
+ else if (A1 == "compute")
+ {
+ ModeStr = "compute";
+ }
+ else if (A1 == "proxy")
+ {
+ ModeStr = "proxy";
+ }
+ else if (A1 == "test")
+ {
+ ModeStr = "test";
+ }
+ }
+ }
+ if (ModeStr != "test")
+ {
+ zen::LogInvocation("zenserver", ModeStr, argc, argv);
+ }
+ }
+
#if ZEN_PLATFORM_WINDOWS
setlocale(LC_ALL, "en_us.UTF8");
#endif // ZEN_PLATFORM_WINDOWS