diff --git a/gui/webgui6/src/TWebCanvas.cxx b/gui/webgui6/src/TWebCanvas.cxx index e64abb55da212..9585c8e363850 100644 --- a/gui/webgui6/src/TWebCanvas.cxx +++ b/gui/webgui6/src/TWebCanvas.cxx @@ -79,19 +79,20 @@ class TWebCanvasTimer : public TTimer { { fSlow = slow; fSlowCnt = 0; - SetTime(slow ? 1000 : 10); + SetTime(slow ? 50 : 10); } /// used to send control messages to clients void Timeout() override { - if (fProcessing || fCanv.fProcessingData) return; + if (fProcessing || fCanv.fProcessingData) + return; fProcessing = kTRUE; Bool_t res = fCanv.CheckDataToSend(); fProcessing = kFALSE; if (res) { fSlowCnt = 0; - } else if (++fSlowCnt > 10 && !IsSlow()) { + } else if (++fSlowCnt > 100 && !IsSlow()) { SetSlow(kTRUE); } } diff --git a/net/http/src/THttpServer.cxx b/net/http/src/THttpServer.cxx index e4b5e19af7051..73aaa27490638 100644 --- a/net/http/src/THttpServer.cxx +++ b/net/http/src/THttpServer.cxx @@ -40,47 +40,19 @@ #include class THttpTimer : public TTimer { - Long_t fNormalTmout{0}; - Bool_t fSlow{kFALSE}; - Int_t fSlowCnt{0}; public: THttpServer &fServer; ///!< server processing requests /// constructor - THttpTimer(Long_t milliSec, Bool_t mode, THttpServer &serv) : TTimer(milliSec, mode), fNormalTmout(milliSec), fServer(serv) {} + THttpTimer(Long_t milliSec, Bool_t mode, THttpServer &serv) : TTimer(milliSec, mode), fServer(serv) {} - void SetSlow(Bool_t flag) - { - fSlow = flag; - fSlowCnt = 0; - Long_t ms = fNormalTmout; - if (fSlow) { - if (ms < 100) - ms = 500; - else if (ms < 500) - ms = 3000; - else - ms = 10000; - } - - SetTime(ms); - } - Bool_t IsSlow() const { return fSlow; } /// timeout handler /// used to process http requests in main ROOT thread void Timeout() override { - Int_t nprocess = fServer.ProcessRequests(); - - if (nprocess > 0) { - fSlowCnt = 0; - if (IsSlow()) - SetSlow(kFALSE); - } else if (!IsSlow() && (fSlowCnt++ > 10)) { - SetSlow(kTRUE); - } + fServer.ProcessRequests(); } }; @@ -656,9 +628,6 @@ Bool_t THttpServer::ExecuteHttp(std::shared_ptr arg) return kTRUE; } - if (fTimer && fTimer->IsSlow()) - fTimer->SetSlow(kFALSE); - // add call arg to the list std::unique_lock lk(fMutex); arg->fNotifyFlag = kFALSE; @@ -1317,9 +1286,6 @@ Bool_t THttpServer::ExecuteWS(std::shared_ptr &arg, Bool_t externa if (external_thrd && (!handler || !handler->AllowMTProcess())) { - if (fTimer && fTimer->IsSlow()) - fTimer->SetSlow(kFALSE); - std::unique_lock lk(fMutex); fArgs.push(arg); // and now wait until request is processed