summaryrefslogtreecommitdiff
path: root/src/bitz/config.cpp
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2015-12-14 06:48:14 +0100
committerJörg Frings-Fürst <debian@jff-webhosting.net>2015-12-14 06:48:14 +0100
commita55a225899dbd47dd4238adf3a49f62846cb87f9 (patch)
tree7c21e99f90be9f073462cf46beca2e0fb936436a /src/bitz/config.cpp
parentfcff49a7ca1f5a8b3813b83cbc578ac6426820fd (diff)
Imported Upstream version 1.0.0upstream/1.0.0
Diffstat (limited to 'src/bitz/config.cpp')
-rw-r--r--src/bitz/config.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/bitz/config.cpp b/src/bitz/config.cpp
index a9ca856..aaa247f 100644
--- a/src/bitz/config.cpp
+++ b/src/bitz/config.cpp
@@ -39,6 +39,7 @@ namespace bitz {
_config.max_workers = 0;
_config.max_worker_requests = 0;
+ _config.comm_timeout = 0;
// defaults
_lconfig = NULL;
@@ -70,11 +71,11 @@ namespace bitz {
try {
config->readFile( config_file.c_str() );
- } catch( const libconfig::FileIOException &ex ) {
+ } catch ( const libconfig::FileIOException &ex ) {
std::cerr << "[config] failed to read config file: " << config_file
<< ", exception: " << ex.what() << std::endl;
exit( EXIT_FAILURE );
- } catch( const libconfig::ParseException &pex ) {
+ } catch ( const libconfig::ParseException &pex ) {
std::cerr << "[config] parse error at " << pex.getFile()
<< ":" << pex.getLine() << " - " << pex.getError() << std::endl;
exit( EXIT_FAILURE );
@@ -91,7 +92,9 @@ namespace bitz {
config->lookupValue( "max_workers", _config.max_workers );
config->lookupValue( "max_worker_requests", _config.max_worker_requests );
- } catch( const libconfig::SettingNotFoundException &e ) {
+ config->lookupValue( "comm_timeout", _config.comm_timeout );
+
+ } catch ( const libconfig::SettingNotFoundException &e ) {
std::cerr << "[config] failed to load core configs, "
<< e.getPath() << " : " << e.what() << std::endl;
}
@@ -121,7 +124,7 @@ namespace bitz {
try {
libconfig::Setting &setting = _lconfig->lookup( std::string( "modules." ).append( module ) );
setting.lookupValue( config, config_value );
- } catch( const libconfig::SettingNotFoundException &e ) {
+ } catch ( const libconfig::SettingNotFoundException &e ) {
// TODO: log errors ??
std::cerr << "[config] " << e.getPath() << " : " << e.what() << std::endl;
}