From deaacc1f67f9f0356ae3c9fa142cea3a239d324b Mon Sep 17 00:00:00 2001 From: erickson Date: Wed, 6 Sep 2006 04:22:03 +0000 Subject: [PATCH] when the gateway is not bootstrapped.. it is useless, doing a short sleep, then going away git-svn-id: svn://svn.open-ils.org/ILS/trunk@5974 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- OpenSRF/src/gateway/osrf_json_gateway.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/OpenSRF/src/gateway/osrf_json_gateway.c b/OpenSRF/src/gateway/osrf_json_gateway.c index 3e157420aa..f370d0c467 100644 --- a/OpenSRF/src/gateway/osrf_json_gateway.c +++ b/OpenSRF/src/gateway/osrf_json_gateway.c @@ -6,6 +6,7 @@ #include "objson/json2xml.h" #include #include +#include #define MODULE_NAME "osrf_json_gateway_module" @@ -88,7 +89,8 @@ static int osrf_json_gateway_method_handler (request_rec *r) { if( !bootstrapped || !osrf_system_get_transport_client()) { ap_log_rerror( APLOG_MARK, APLOG_ERR, 0, r, "Cannot process request " "because the OpenSRF JSON gateway has not been bootstrapped..."); - return HTTP_INTERNAL_SERVER_ERROR; + usleep( 100000 ); /* 100 milliseconds */ + exit(1); } osrfLogSetAppname("osrf_json_gw"); @@ -170,7 +172,7 @@ static int osrf_json_gateway_method_handler (request_rec *r) { osrfLogError(OSRF_LOG_MARK, "I am unable to communcate with opensrf..going away..."); /* we don't want to spawn an intense re-forking storm * if there is no jabber server.. so give it some time before we die */ - sleep(1); + usleep( 100000 ); /* 100 milliseconds */ exit(1); } -- 2.43.2