@@ -174,26 +174,29 @@ int ctpCCDBManager::saveCtpCfg(uint32_t runNumber, long timeStart)
174174 return 0 ;
175175 }
176176 CtpCfg ctpcfg;
177- ctpcfg.readAndSave (mCtpCfgDir );
178- using namespace std ::chrono_literals;
179- std::chrono::seconds days3 = 259200s;
180- std::chrono::seconds min10 = 600s;
181- long time3days = std::chrono::duration_cast<std::chrono::milliseconds>(days3).count ();
182- long time10min = std::chrono::duration_cast<std::chrono::milliseconds>(min10).count ();
183- long tmin = timeStart - time10min;
184- long tmax = timeStart + time3days;
185- o2::ccdb::CcdbApi api;
186- map<string, string> metadata; // can be empty
187- metadata[" runNumber" ] = std::to_string (runNumber);
188- api.init (mCCDBHost .c_str ()); // or http://localhost:8080 for a local installation
189- // store abitrary user object in strongly typed manner
190- int ret = api.storeAsTFileAny (&ctpcfg, mCCDBPathCtpCfg , metadata, tmin, tmax);
191- if (ret == 0 ) {
192- LOG (info) << " CtpCfg saved in ccdb:" << mCCDBHost << " tmin:" << tmin << " tmax:" << tmax;
193- } else {
194- LOG (error) << " CtpCfg Problem writing to database ret:" << ret;
195- }
196- return 0 ;
177+ int ret;
178+ ctpcfg.readAndSave (mCtpCfgDir , ret);
179+ if (ret == 0 ) {
180+ using namespace std ::chrono_literals;
181+ std::chrono::seconds days3 = 259200s;
182+ std::chrono::seconds min10 = 600s;
183+ long time3days = std::chrono::duration_cast<std::chrono::milliseconds>(days3).count ();
184+ long time10min = std::chrono::duration_cast<std::chrono::milliseconds>(min10).count ();
185+ long tmin = timeStart - time10min;
186+ long tmax = timeStart + time3days;
187+ o2::ccdb::CcdbApi api;
188+ map<string, string> metadata; // can be empty
189+ metadata[" runNumber" ] = std::to_string (runNumber);
190+ api.init (mCCDBHost .c_str ()); // or http://localhost:8080 for a local installation
191+ // store abitrary user object in strongly typed manner
192+ ret = api.storeAsTFileAny (&ctpcfg, mCCDBPathCtpCfg , metadata, tmin, tmax);
193+ if (ret == 0 ) {
194+ LOG (info) << " CtpCfg saved in ccdb:" << mCCDBHost << " tmin:" << tmin << " tmax:" << tmax;
195+ } else {
196+ LOG (error) << " CtpCfg Problem writing to database ret:" << ret;
197+ }
198+ }
199+ return ret;
197200}
198201CTPConfiguration ctpCCDBManager::getConfigFromCCDB (long timestamp, std::string run, bool & ok)
199202{
0 commit comments