aboutsummaryrefslogtreecommitdiff
path: root/src/zen/cmds/projectstore_cmd.cpp
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2025-01-16 09:19:38 +0100
committerGitHub Enterprise <[email protected]>2025-01-16 09:19:38 +0100
commit06612946b7ef6d82bb08afd0782e5cacb9fda0fd (patch)
treeb9cd3326356c01c16e28a25a65dea5b5b405e505 /src/zen/cmds/projectstore_cmd.cpp
parentmove basicfile.h/cpp -> zencore (#273) (diff)
downloadarchived-zen-06612946b7ef6d82bb08afd0782e5cacb9fda0fd.tar.xz
archived-zen-06612946b7ef6d82bb08afd0782e5cacb9fda0fd.zip
export oplog to zen target url (#274)
* fix oplog target url for oplog export to remote zenserver * verify that chunking is allowed before chunking loose files
Diffstat (limited to 'src/zen/cmds/projectstore_cmd.cpp')
-rw-r--r--src/zen/cmds/projectstore_cmd.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/zen/cmds/projectstore_cmd.cpp b/src/zen/cmds/projectstore_cmd.cpp
index 30822a8d9..6bc499f03 100644
--- a/src/zen/cmds/projectstore_cmd.cpp
+++ b/src/zen/cmds/projectstore_cmd.cpp
@@ -1047,15 +1047,16 @@ ExportOplogCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** arg
TargetUrlBase = fmt::format("http://{}", TargetUrlBase);
}
+ HttpClient TargetHttp(TargetUrlBase);
std::string Url = fmt::format("/prj/{}/oplog/{}", m_ZenProjectName, m_ZenOplogName);
bool CreateOplog = false;
- if (HttpClient::Response Result = Http.Get(Url, HttpClient::Accept(ZenContentType::kJSON)))
+ if (HttpClient::Response Result = TargetHttp.Get(Url, HttpClient::Accept(ZenContentType::kJSON)))
{
if (m_ZenClean)
{
ZEN_WARN("Deleting zen remote oplog '{}/{}'", m_ZenProjectName, m_ZenOplogName)
- Result = Http.Delete(Url, HttpClient::Accept(ZenContentType::kJSON));
+ Result = TargetHttp.Delete(Url, HttpClient::Accept(ZenContentType::kJSON));
if (!Result)
{
Result.ThrowError("failed deleting existing zen remote oplog"sv);
@@ -1077,7 +1078,7 @@ ExportOplogCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** arg
if (CreateOplog)
{
ZEN_WARN("Creating zen remote oplog '{}/{}'", m_ZenProjectName, m_ZenOplogName);
- if (HttpClient::Response Result = Http.Post(Url); !Result)
+ if (HttpClient::Response Result = TargetHttp.Post(Url); !Result)
{
Result.ThrowError("failed creating zen remote oplog"sv);
return 1;