9 m_latencyInLumisections(iConfig.getUntrackedParameter<unsigned
int>(
"latency", 1)),
10 m_lastLumiUrl(iConfig.getUntrackedParameter<
std::
string>(
"lastLumiUrl",
"")),
11 m_preLoadConnectionString(iConfig.getUntrackedParameter<
std::
string>(
"preLoadConnectionString",
"")),
12 m_debug(iConfig.getUntrackedParameter<
bool>(
"debugLogging",
false)) {
37 char errbuf[CURL_ERROR_SIZE];
39 curl = curl_easy_init();
42 struct curl_slist* chunk =
nullptr;
43 chunk = curl_slist_append(chunk,
"content-type:document/plain");
44 curl_easy_setopt(curl, CURLOPT_HTTPHEADER, chunk);
45 curl_easy_setopt(curl, CURLOPT_URL, urlString.c_str());
47 curl_easy_setopt(curl, CURLOPT_WRITEDATA, &htmlBuffer);
48 curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, errbuf);
49 res = curl_easy_perform(curl);
50 if (CURLE_OK ==
res) {
54 size_t len = strlen(errbuf);
57 fprintf(
stderr,
"%s%s", errbuf, ((errbuf[len - 1] !=
'\n') ?
"\n" :
""));
59 fprintf(
stderr,
"%s\n", curl_easy_strerror(
res));
61 curl_easy_cleanup(curl);
68 unsigned int lastL = 0;
69 if (!m_lastLumiUrl.empty()) {
72 throw Exception(
"Can't get last Lumisection from DAQ.");
73 lastL = boost::lexical_cast<unsigned int>(
info);
75 edm::LogInfo(MSGSOURCE) <<
"Last lumi: " << lastLumiProcessed <<
" Current run: " << m_runNumber
76 <<
" lumi id:" << lastL;
78 if (m_lastLumiFile.empty()) {
84 throw Exception(
"File name for last lumi has not been provided.");
88 edm::LogInfo(MSGSOURCE) <<
"Last lumi: " << lastLumiProcessed <<
" Current run: " << upkTime.first
89 <<
" lumi id:" << upkTime.second;
92 return lastLumiProcessed;
98 transaction.
start(
true);
101 transaction.commit();