comparison OrthancServer/ServerIndex.cpp @ 1239:92c6b3b57699

cleaning
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 05 Dec 2014 16:22:18 +0100
parents 6c07108ff1e2
children 62c35e4b67db
comparison
equal deleted inserted replaced
1238:6c07108ff1e2 1239:92c6b3b57699
343 unsigned int sleep = 10; 343 unsigned int sleep = 10;
344 344
345 try 345 try
346 { 346 {
347 boost::mutex::scoped_lock lock(that->mutex_); 347 boost::mutex::scoped_lock lock(that->mutex_);
348 std::string sleepString = that->db_->GetGlobalProperty(GlobalProperty_FlushSleep, ""); 348 std::string sleepString;
349 349
350 if (Toolbox::IsInteger(sleepString)) 350 if (that->db_->LookupGlobalProperty(sleepString, GlobalProperty_FlushSleep) &&
351 Toolbox::IsInteger(sleepString))
351 { 352 {
352 sleep = boost::lexical_cast<unsigned int>(sleepString); 353 sleep = boost::lexical_cast<unsigned int>(sleepString);
353 } 354 }
354 } 355 }
355 catch (boost::bad_lexical_cast&) 356 catch (boost::bad_lexical_cast&)
1915 1916
1916 std::string ServerIndex::GetGlobalProperty(GlobalProperty property, 1917 std::string ServerIndex::GetGlobalProperty(GlobalProperty property,
1917 const std::string& defaultValue) 1918 const std::string& defaultValue)
1918 { 1919 {
1919 boost::mutex::scoped_lock lock(mutex_); 1920 boost::mutex::scoped_lock lock(mutex_);
1920 return db_->GetGlobalProperty(property, defaultValue); 1921
1922 std::string value;
1923 if (db_->LookupGlobalProperty(value, property))
1924 {
1925 return value;
1926 }
1927 else
1928 {
1929 return defaultValue;
1930 }
1921 } 1931 }
1922 1932
1923 } 1933 }