Changeset 12538 for trunk/FACT++
- Timestamp:
- 11/16/11 15:53:10 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/datalogger.cc
r12536 r12538 389 389 //Current day variable. Used to close nightly files when night changes 390 390 int fCurrentDay; 391 Time lastFlush; 391 392 public: 392 393 int Write(const Time &time, const std::string &txt, int qos=kMessage); … … 759 760 const Time nowMinusTwelve = timeNow-boost::posix_time::hours(12); 760 761 fCurrentDay = nowMinusTwelve.M()*31 + nowMinusTwelve.D();//assume 31 days per month. we do not really care, only want unique number per day of the year 762 lastFlush = Time(); 761 763 762 764 //Give a name to this machine's specific states … … 1178 1180 int newDayNumber = nowMinusTwelve.M()*31 + nowMinusTwelve.D();//assume 31 days per month. we do not really care, only want unique number per day of the year 1179 1181 1182 //also check if we should flush the nightly files 1183 if (lastFlush < timeNow-boost::posix_time::minutes(1)) 1184 { 1185 lastFlush = timeNow; 1186 SubscriptionsListType::iterator x; 1187 map<string, SubscriptionType>::iterator y; 1188 for (x=fServiceSubscriptions.begin(); x != fServiceSubscriptions.end(); x++) 1189 {//find current service is subscriptions 1190 for (y=x->second.begin(); y!=x->second.end();y++) 1191 if (y->second.nightlyFile.IsOpen()) 1192 { 1193 y->second.nightlyFile.Flush(); 1194 } 1195 } 1196 if (fDebugIsOn) 1197 Debug("Just flushed nightly fits files to the disk"); 1198 } 1199 1180 1200 // if (Time().h() == 12 && !fDailyFileDayChangedAlready) 1181 1201 if (newDayNumber != fCurrentDay) … … 1905 1925 return; 1906 1926 } 1907 sub.nightlyFile.Flush();1927 // sub.nightlyFile.Flush(); 1908 1928 } 1909 1929
Note:
See TracChangeset
for help on using the changeset viewer.