Changeset 1532
- Timestamp:
- 04/16/08 19:45:38 (4 weeks ago)
- Files:
-
- honeyclient/trunk/etc/honeyclient.xml (modified) (1 diff)
- honeyclient/trunk/lib/HoneyClient/Manager/Database.pm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
honeyclient/trunk/etc/honeyclient.xml
r1523 r1532 206 206 http://172.16.164.1/hc_database/api 207 207 </url> 208 <max_retry_count description="If the Manager is unable to contact the Ruby web service due to connectivity issues, then the Manager will retry up to the specified number of times before giving up." default="1800"> 209 1800 210 </max_retry_count> 211 <delay_between_retries description="If the Manager is unable to contact the Ruby web service due to connectivity issues, then the Manager will retry, waiting the specified amount of time (in seconds) between each retry attempt." default="2"> 212 2 213 </delay_between_retries> 208 214 </Database> 209 215 <!-- HoneyClient::Manager::FW Options --> honeyclient/trunk/lib/HoneyClient/Manager/Database.pm
r1499 r1532 241 241 my $xmlrpc = XML::RPC->new(getVar(name => "url"), %options); 242 242 my $ret = undef; 243 244 eval { 245 $ret = $xmlrpc->call($name,@_); 246 }; 247 243 244 # Retry if communications fail intermittently. 245 my $count = 0; 246 while (($@ || !defined($ret)) && ($count < getVar(name => "max_retry_count"))) { 247 eval { 248 $ret = $xmlrpc->call($name,@_); 249 }; 250 if ($@ || !defined($ret)) { 251 $LOG->warn("Database connectivity lost. Retrying in (" . getVar(name => "delay_between_retries") . ") seconds."); 252 sleep(getVar(name => "delay_between_retries")); 253 } 254 $count++; 255 } 248 256 # Error checking. 249 257 if ($@ || !defined($ret)) {
