Skip to content

Commit

Permalink
added a wait time of 30s between consecutive pushes to ccdb
Browse files Browse the repository at this point in the history
  • Loading branch information
iravasen authored and shahor02 committed Oct 9, 2023
1 parent 2d1a974 commit 8478a42
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ class ITSDCSAdaposParser : public Task
std::string mCcdbFetchUrl = "http://ccdb-test.cern.ch:8080";
o2::ccdb::BasicCCDBManager& mMgr = o2::ccdb::BasicCCDBManager::instance();
long int startTime;

// to avoid several pushes to CCDB
long int pushTime = 0;
long int lastPushTime = 0;
};

// Create a processor spec
Expand Down
10 changes: 9 additions & 1 deletion Detectors/ITSMFT/ITS/workflow/src/DCSAdaposParserSpec.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,12 @@ void ITSDCSAdaposParser::process(const gsl::span<const DPCOM> dps)
}
if (mapel->second.payload_pt1 + 8 != mCcdbAlpideParam->roFrameLengthInBC) {
mStrobeToUpload = mapel->second.payload_pt1;
doStrobeUpload = true;
pushTime = o2::ccdb::getCurrentTimestamp();
if (pushTime - lastPushTime > 30000) { // push to CCDB only if at least 30s passed from the last push
doStrobeUpload = true;
} else {
doStrobeUpload = false;
}
} else {
doStrobeUpload = false;
}
Expand Down Expand Up @@ -196,6 +201,9 @@ void ITSDCSAdaposParser::pushToCCDB(ProcessingContext& pc)
info.getMetaData(), info.getStartValidityTimestamp(), info.getEndValidityTimestamp());
}

// uptade lastPushTime
lastPushTime = o2::ccdb::getCurrentTimestamp();

return;
}

Expand Down

0 comments on commit 8478a42

Please sign in to comment.