aboutsummaryrefslogtreecommitdiff
path: root/src
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
parentmove basicfile.h/cpp -> zencore (#273) (diff)
downloadzen-06612946b7ef6d82bb08afd0782e5cacb9fda0fd.tar.xz
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')
-rw-r--r--src/zen/cmds/projectstore_cmd.cpp7
-rw-r--r--src/zenserver/projectstore/remoteprojectstore.cpp2
2 files changed, 5 insertions, 4 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;
diff --git a/src/zenserver/projectstore/remoteprojectstore.cpp b/src/zenserver/projectstore/remoteprojectstore.cpp
index df77deab8..0589fdc5f 100644
--- a/src/zenserver/projectstore/remoteprojectstore.cpp
+++ b/src/zenserver/projectstore/remoteprojectstore.cpp
@@ -1688,7 +1688,7 @@ BuildContainer(CidStore& ChunkStore,
IoBuffer RawData = IoBufferBuilder::MakeFromFile(FilePath);
if (RawData)
{
- if (RawData.GetSize() > ChunkFileSizeLimit)
+ if (AllowChunking && RawData.GetSize() > ChunkFileSizeLimit)
{
IoBufferFileReference FileRef;
(void)RawData.GetFileReference(FileRef);