Skip to content

Commit 50c4217

Browse files
committed
Revert "Fix for headers-only CCDB uploads"
This reverts commit 7b3397d.
1 parent 9634a2e commit 50c4217

File tree

2 files changed

+2
-15
lines changed

2 files changed

+2
-15
lines changed

CCDB/src/CcdbApi.cxx

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -369,10 +369,6 @@ int CcdbApi::storeAsBinaryFile(const char* buffer, size_t size, const std::strin
369369
sanitizedEndValidityTimestamp = getFutureTimestamp(60 * 60 * 24 * 1);
370370
}
371371
if (mInSnapshotMode) { // write local file
372-
if (filename.empty() || buffer == nullptr || size == 0) {
373-
LOGP(alarm, "Snapshot mode does not support headers-only upload");
374-
return -3;
375-
}
376372
auto pthLoc = getSnapshotDir(mSnapshotTopPath, path);
377373
o2::utils::createDirectoriesIfAbsent(pthLoc);
378374
auto flLoc = getSnapshotFile(mSnapshotTopPath, path, filename);
@@ -416,14 +412,8 @@ int CcdbApi::storeAsBinaryFile(const char* buffer, size_t size, const std::strin
416412
auto mime = curl_mime_init(curl);
417413
auto field = curl_mime_addpart(mime);
418414
curl_mime_name(field, "send");
419-
if (filename.empty()) {
420-
curl_mime_filedata(field, filename.c_str());
421-
}
422-
if (buffer != nullptr && size > 0) {
423-
curl_mime_data(field, buffer, size);
424-
} else {
425-
curl_mime_data(field, "", 0);
426-
}
415+
curl_mime_filedata(field, filename.c_str());
416+
curl_mime_data(field, buffer, size);
427417

428418
struct curl_slist* headerlist = nullptr;
429419
static const char buf[] = "Expect:";

CCDB/src/UploadTool.cxx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,6 @@ int main(int argc, char* argv[])
148148
}
149149

150150
if (filename == "headersOnly") {
151-
auto ent = meta.find("Redirect");
152-
std::cout << " Uploading a headers-only object to path " << path << " with timestamp validity from " << starttimestamp << " to " << endtimestamp
153-
<< " Redirection to: " << ((ent != meta.end()) ? ent->second : std::string{"none"}) << "\n";
154151
api.storeAsBinaryFile(nullptr, 0, "ignored", "", path, meta, starttimestamp, endtimestamp);
155152
if (!api.isSnapshotMode() && meta.find("adjustableEOV") != meta.end() && meta.find("default") == meta.end()) {
156153
o2::ccdb::CcdbObjectInfo oi(path, "", "", meta, starttimestamp, endtimestamp);

0 commit comments

Comments
 (0)