diff --git a/baseconnection.pas b/baseconnection.pas index 32d9798..2d33b08 100644 --- a/baseconnection.pas +++ b/baseconnection.pas @@ -80,7 +80,7 @@ type nCommandReceived: integer; nCommandReady: integer; nErrors: integer; - + fCheckConnect: boolean; procedure CleanDone; public Host: string; @@ -109,6 +109,7 @@ type function RunCommand(ACommand: TCommand): boolean; function FindCommand(IDCommand: string): TCommand; procedure Idle; + procedure SetIdle; procedure Execute; override; function ProcessOptionValues(ReportName,ParamName: string; ParamValues: TStrings; out Answer: string; out RetValue: QWORD; out OptionValues: TStrings): boolean; class function newID: string; @@ -232,6 +233,7 @@ procedure TBaseConnection.Idle; var d: TDateTime; begin + fCheckConnect:=false; d := Created; if LastAccess>d then d := LastAccess; if (now()-d)*24*60>fTimeout then @@ -243,6 +245,11 @@ begin fProcessor.ExecuteSQL('SELECT 1'); end; +procedure TBaseConnection.SetIdle; +begin + fCheckConnect:=true; +end; + procedure TBaseConnection.CleanDone; var i: integer; @@ -286,7 +293,8 @@ begin end; end; CleanDone; - sleep(100); + if fCheckConnect then Idle; + sleep(200); end; log(self,'finished'); end; diff --git a/connectionsdmunit.pas b/connectionsdmunit.pas index 0305c51..ee631c0 100644 --- a/connectionsdmunit.pas +++ b/connectionsdmunit.pas @@ -537,7 +537,7 @@ begin MainCon.ExecuteSQL('select 1'); for i := conlist.Count-1 downto 0 do if not TBaseConnection(conList[i]).Finished then - TBaseConnection(conList[i]).Idle; + TBaseConnection(conList[i]).SetIdle; end; initialization diff --git a/lms_cgi_server.lpi b/lms_cgi_server.lpi index edd5fe9..ebb01a9 100644 --- a/lms_cgi_server.lpi +++ b/lms_cgi_server.lpi @@ -76,7 +76,9 @@ + +