Dalsi zmeny
This commit is contained in:
266
uWinService.pas
266
uWinService.pas
@ -7,7 +7,7 @@ uses
|
||||
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.SvcMgr,
|
||||
Vcl.Dialogs, Winapi.ShellAPI, Winapi.ActiveX, IdHTTPWebBrokerBridge, Xml.XmlIntf, Xml.xmldom, Xml.XMLDoc, JsonDataObjects,
|
||||
System.IOUtils, System.SyncObjs, IdBaseComponent, IdComponent, IdServerIOHandler, IdSSL, IdHTTP, IdURI,
|
||||
IdSSLOpenSSL, IdSSLOpenSSLHeaders, IdIOHandler, IdIOHandlerSocket, IdIOHandlerStack,
|
||||
IdSSLOpenSSL, IdSSLOpenSSLHeaders, IdIOHandler, IdIOHandlerSocket, IdIOHandlerStack, IdException, IdStack,
|
||||
FireDAC.Stan.Intf, FireDAC.Stan.Option, FireDAC.Stan.Param,
|
||||
FireDAC.Stan.Error, FireDAC.DatS, FireDAC.Phys.Intf, FireDAC.DApt.Intf,
|
||||
FireDAC.Stan.Async, FireDAC.DApt, Data.DB, FireDAC.Comp.DataSet, FireDAC.Comp.Client,
|
||||
@ -17,6 +17,12 @@ uses
|
||||
{$ENDIF}
|
||||
{$IFDEF CUSTOM_CTRL_Gornicky}
|
||||
{$I ./_custom/Gornicky/winSvc/usesTop.inc}
|
||||
{$ENDIF}
|
||||
{$IFDEF CUSTOM_CTRL_Westra}
|
||||
{$I ./_custom/Westra/winSvc/usesTop.inc}
|
||||
{$ENDIF}
|
||||
{$IFDEF CUSTOM_CTRL_EMPolar}
|
||||
{$I ./_custom/EMPolar/winSvc/usesTop.inc}
|
||||
{$ENDIF}
|
||||
flcCipher, Quick.Logger, Quick.Threads, Quick.Logger.Provider.Files;
|
||||
|
||||
@ -67,6 +73,10 @@ const
|
||||
{$I ./_custom/Gornicky/winSvc/consts.inc}
|
||||
{$ENDIF}
|
||||
|
||||
{$IFDEF CUSTOM_CTRL_Westra}
|
||||
{$I ./_custom/Westra/winSvc/consts.inc}
|
||||
{$ENDIF}
|
||||
|
||||
|
||||
uqLicMutex = '{77567050-19D8-45EB-B32A-B431079E45AD}';
|
||||
MY_MSG_SERVICE_CONTROL = 1;
|
||||
@ -93,8 +103,8 @@ const
|
||||
|
||||
type
|
||||
TSSLEventHandlers = class
|
||||
procedure OnGetSSLPassword(var APassword: {$IF CompilerVersion < 27}AnsiString{$ELSE}string{$ENDIF});
|
||||
procedure OnQuerySSLPort(APort: Word; var VUseSSL: boolean);
|
||||
procedure OnGetSSLPassword (var APassword: {$IF CompilerVersion < 27}AnsiString{$ELSE}string{$ENDIF});
|
||||
procedure OnQuerySSLPort (APort: Word; var VUseSSL: boolean);
|
||||
end;
|
||||
|
||||
|
||||
@ -102,6 +112,17 @@ const
|
||||
{$I ./_custom/Gornicky/winSvc/types.inc}
|
||||
{$ENDIF}
|
||||
|
||||
{$IFDEF CUSTOM_CTRL_Westra}
|
||||
{$I ./_custom/Westra/winSvc/types.inc}
|
||||
{$ENDIF}
|
||||
|
||||
{$IFDEF CUSTOM_CTRL_EMPolar}
|
||||
{$I ./_custom/EMPolar/winSvc/types.inc}
|
||||
{$ENDIF}
|
||||
|
||||
{$IFDEF CUSTOM_CTRL_Rootvin}
|
||||
{$I ./_custom/Rootvin/winSvc/types.inc}
|
||||
{$ENDIF}
|
||||
|
||||
THeoZpracujJSONThread = class(TThread)
|
||||
private
|
||||
@ -188,6 +209,15 @@ const
|
||||
{$IFDEF CUSTOM_CTRL_Gornicky}
|
||||
{$I ./_custom/Gornicky/winSvc/mainPrivs.inc}
|
||||
{$ENDIF}
|
||||
{$IFDEF CUSTOM_CTRL_Westra}
|
||||
{$I ./_custom/Westra/winSvc/mainPrivs.inc}
|
||||
{$ENDIF}
|
||||
{$IFDEF CUSTOM_CTRL_EMPolar}
|
||||
{$I ./_custom/EMPolar/winSvc/mainPrivs.inc}
|
||||
{$ENDIF}
|
||||
{$IFDEF CUSTOM_CTRL_Rootvin}
|
||||
{$I ./_custom/Rootvin/winSvc/mainPrivs.inc}
|
||||
{$ENDIF}
|
||||
|
||||
{$IFDEF OMNIThreadLib}
|
||||
tskLicKontrola: IOmniTaskControl;
|
||||
@ -279,16 +309,36 @@ var
|
||||
{$I ./_custom/Gornicky/winSvc/vars.inc}
|
||||
{$ENDIF}
|
||||
|
||||
{$IFDEF CUSTOM_CTRL_Westra}
|
||||
{$I ./_custom/Westra/winSvc/vars.inc}
|
||||
{$ENDIF}
|
||||
|
||||
{$IFDEF CUSTOM_CTRL_EMPolar}
|
||||
{$I ./_custom/EMPolar/winSvc/vars.inc}
|
||||
{$ENDIF}
|
||||
|
||||
{$IFDEF CUSTOM_CTRL_Rootvin}
|
||||
{$I ./_custom/Rootvin/winSvc/vars.inc}
|
||||
{$ENDIF}
|
||||
|
||||
|
||||
|
||||
implementation
|
||||
uses
|
||||
System.StrUtils, System.Win.Registry, System.Variants, IdContext, System.Generics.Collections, System.DateUtils,
|
||||
Winapi.WinSvc,
|
||||
Web.WebReq, System.Hash, MVCFramework.Commons, MVCFramework.Logger,
|
||||
{$IFDEF CUSTOM_CTRL_Gornicky}
|
||||
{$I ./_custom/Gornicky/winSvc/uses.inc}
|
||||
{$ENDIF}
|
||||
{$IFDEF CUSTOM_CTRL_Westra}
|
||||
{$I ./_custom/Westra/winSvc/uses.inc}
|
||||
{$ENDIF}
|
||||
{$IFDEF CUSTOM_CTRL_EMPolar}
|
||||
{$I ./_custom/EMPolar/winSvc/uses.inc}
|
||||
{$ENDIF}
|
||||
{$IFDEF CUSTOM_CTRL_Rootvin}
|
||||
{$I ./_custom/Rootvin/winSvc/uses.inc}
|
||||
{$ENDIF}
|
||||
helTabsBIDs,
|
||||
uWebMod, uDataMod;
|
||||
@ -344,6 +394,17 @@ uses
|
||||
{$I ./_custom/Gornicky/winSvc/impl.inc}
|
||||
{$ENDIF}
|
||||
|
||||
{$IFDEF CUSTOM_CTRL_Westra}
|
||||
{$I ./_custom/Westra/winSvc/impl.inc}
|
||||
{$ENDIF}
|
||||
|
||||
{$IFDEF CUSTOM_CTRL_EMPolar}
|
||||
{$I ./_custom/EMPolar/winSvc/impl.inc}
|
||||
{$ENDIF}
|
||||
|
||||
{$IFDEF CUSTOM_CTRL_Rootvin}
|
||||
{$I ./_custom/Rootvin/winSvc/impl.inc}
|
||||
{$ENDIF}
|
||||
|
||||
|
||||
|
||||
@ -452,7 +513,7 @@ uses
|
||||
|
||||
if (sqlConnX.Connected) then
|
||||
begin
|
||||
lSQL:= 'SELECT d.ID FROM ' + tblPrijataJsonData + ' d WHERE d.Blokovano=0 AND d.DatZpracovani IS NULL';
|
||||
lSQL:= 'SELECT d.ID FROM ' + tblPrijataJsonData + ' d WITH(NOLOCK) WHERE d.Blokovano=0 AND d.DatZpracovani IS NULL';
|
||||
lSQL:= lSQL + ' AND ISNULL(d.PosledniChyba,N'''')=N''''';
|
||||
lSQL:= lSQL + ' AND d.Blokovano=0 '; // AND ISNULL( (SELECT COUNT(ID) FROM dbo._hdc_ph_Log WHERE LogText=N''Zpracovani API json'' AND IntValue=d.ID), 0)<4';
|
||||
lSQL:= lSQL + ' ORDER BY d.ID';
|
||||
@ -472,7 +533,7 @@ uses
|
||||
|
||||
lQry2:= TFDQuery.Create(nil);
|
||||
lQry2.Connection:= sqlConnX;
|
||||
lQry2.Open('SELECT COUNT(ID) AS Pocet FROM dbo._hdc_ph_Log WHERE IntValue=' + idTask.ToString + ' AND LogText LIKE N''%Zpracova%''');
|
||||
lQry2.Open('SELECT COUNT(ID) AS Pocet FROM dbo._hdc_ph_Log WITH(NOLOCK) WHERE IntValue=' + idTask.ToString + ' AND LogText LIKE N''%Zpracova%''');
|
||||
lQry2.First;
|
||||
cnt:= lQry2.FieldByName('Pocet').AsInteger;
|
||||
FreeAndNil(lQry2);
|
||||
@ -1364,6 +1425,18 @@ Logger.WriteLog(logItem);
|
||||
{$I ./_custom/Gornicky/winSvc/mainSvcCont.inc}
|
||||
{$ENDIF}
|
||||
|
||||
{$IFDEF CUSTOM_CTRL_Westra}
|
||||
{$I ./_custom/Westra/winSvc/mainSvcCont.inc}
|
||||
{$ENDIF}
|
||||
|
||||
{$IFDEF CUSTOM_CTRL_EMPolar}
|
||||
{$I ./_custom/EMPolar/winSvc/mainSvcCont.inc}
|
||||
{$ENDIF}
|
||||
|
||||
{$IFDEF CUSTOM_CTRL_Rootvin}
|
||||
{$I ./_custom/Rootvin/winSvc/mainSvcCont.inc}
|
||||
{$ENDIF}
|
||||
|
||||
if (zapisDZTasksThr<>nil) then
|
||||
if (zapisDZTasksThr.Suspended) then
|
||||
zapisDZTasksThr.Resume;
|
||||
@ -1471,6 +1544,18 @@ Logger.WriteLog(logItem);
|
||||
{$I ./_custom/Gornicky/winSvc/mainSvcExec.inc}
|
||||
{$ENDIF}
|
||||
|
||||
{$IFDEF CUSTOM_CTRL_Westra}
|
||||
{$I ./_custom/Westra/winSvc/mainSvcExec.inc}
|
||||
{$ENDIF}
|
||||
|
||||
{$IFDEF CUSTOM_CTRL_EMPolar}
|
||||
{$I ./_custom/EMPolar/winSvc/mainSvcExec.inc}
|
||||
{$ENDIF}
|
||||
|
||||
{$IFDEF CUSTOM_CTRL_Rootvin}
|
||||
{$I ./_custom/Rootvin/winSvc/mainSvcExec.inc}
|
||||
{$ENDIF}
|
||||
|
||||
end;
|
||||
|
||||
|
||||
@ -1506,6 +1591,18 @@ Logger.WriteLog(logItem);
|
||||
{$I ./_custom/Gornicky/winSvc/mainSvcPause.inc}
|
||||
{$ENDIF}
|
||||
|
||||
{$IFDEF CUSTOM_CTRL_Westra}
|
||||
{$I ./_custom/Westra/winSvc/mainSvcPause.inc}
|
||||
{$ENDIF}
|
||||
|
||||
{$IFDEF CUSTOM_CTRL_EMPolar}
|
||||
{$I ./_custom/EMPolar/winSvc/mainSvcPause.inc}
|
||||
{$ENDIF}
|
||||
|
||||
{$IFDEF CUSTOM_CTRL_Rootvin}
|
||||
{$I ./_custom/Rootvin/winSvc/mainSvcPause.inc}
|
||||
{$ENDIF}
|
||||
|
||||
Paused:= True;
|
||||
end;
|
||||
|
||||
@ -1613,6 +1710,7 @@ Logger.WriteLog(logItem);
|
||||
else
|
||||
begin
|
||||
datMod.LogInfo (Quick.Logger.etCritical, 'Nespravny format konfiguracniho souboru (hdcDZAPIcfg.dat)');
|
||||
datMod.LogInfo (Quick.Logger.etCritical, s);
|
||||
result:= false;
|
||||
CoUninitialize;
|
||||
Exit;
|
||||
@ -1792,7 +1890,7 @@ Writeln('DB: ' + datMod.dbName);
|
||||
end;
|
||||
|
||||
s:= 'Konfigurace - HTTP/S API port ' + apiPort.ToString + ' / SSL ' + IfThen(jeSSL, 'ano', 'ne') + ' / SQL server ' + datMod.dbServer + IfThen(datMod.dbPort<>1433, ':' + datMod.dbPort.ToString, '');
|
||||
s:= s + ' / databaze ' + datMod.dbName + ' / SQL conn Encrypted ' + IfThen(datMod.dbEncConn, 'ano', 'ne');
|
||||
s:= s + ' / databaze ' + datMod.dbName + ' / user ' + datMod.dbUser + ' / SQL conn Encrypted ' + IfThen(datMod.dbEncConn, 'ano', 'ne');
|
||||
{$IFDEF CUSTOM_CTRL_Rootvin}
|
||||
s:= s + ' / custom ROOTVIN';
|
||||
{$ENDIF}
|
||||
@ -1807,6 +1905,12 @@ Writeln('DB: ' + datMod.dbName);
|
||||
{$ENDIF}
|
||||
{$IFDEF CUSTOM_CTRL_Gornicky}
|
||||
s:= s + ' / custom Gornicky';
|
||||
{$ENDIF}
|
||||
{$IFDEF CUSTOM_CTRL_Westra}
|
||||
s:= s + ' / custom MBM Westra';
|
||||
{$ENDIF}
|
||||
{$IFDEF CUSTOM_CTRL_EMPolar}
|
||||
s:= s + ' / custom EMPolar';
|
||||
{$ENDIF}
|
||||
datMod.LogInfo (Quick.Logger.etInfo, s);
|
||||
except on E:Exception do
|
||||
@ -1880,6 +1984,20 @@ Writeln('DB: ' + datMod.dbName);
|
||||
result:= false;
|
||||
end;
|
||||
{$ENDIF}
|
||||
{$IFDEF CUSTOM_CTRL_Westra}
|
||||
if (datMod.dbName<>'Westra') then
|
||||
begin
|
||||
errMsg:= ' - Chybna DB: custom Westra x db ' + datMod.dbName;
|
||||
result:= false;
|
||||
end;
|
||||
{$ENDIF}
|
||||
{$IFDEF CUSTOM_CTRL_EMPolar}
|
||||
if (datMod.dbName<>'EMPolar') then
|
||||
begin
|
||||
errMsg:= ' - Chybna DB: custom EMPolar x db ' + datMod.dbName;
|
||||
result:= false;
|
||||
end;
|
||||
{$ENDIF}
|
||||
{$ELSE}
|
||||
if (datMod.dbServer<>'') then
|
||||
begin
|
||||
@ -1923,6 +2041,20 @@ Writeln('DB: ' + datMod.dbName);
|
||||
errMsg:= ' - Chybna DB';
|
||||
result:= false;
|
||||
end;
|
||||
{$ENDIF}
|
||||
{$IFDEF CUSTOM_CTRL_GornickyGrp}
|
||||
if (sTemp<>'63887282') then
|
||||
begin
|
||||
errMsg:= ' - Chybna DB';
|
||||
result:= false;
|
||||
end;
|
||||
{$ENDIF}
|
||||
{$IFDEF CUSTOM_CTRL_Westra}
|
||||
if (sTemp<>'60066130') then
|
||||
begin
|
||||
errMsg:= ' - Chybna DB';
|
||||
result:= false;
|
||||
end;
|
||||
{$ENDIF}
|
||||
end;
|
||||
end;
|
||||
@ -2034,7 +2166,7 @@ Writeln('DB: ' + datMod.dbName);
|
||||
ms: TMemoryStream;
|
||||
arrDefs: TStringList;
|
||||
i, iTemp: integer;
|
||||
canCont, canCont2: boolean;
|
||||
canCont, canCont2, canCont3: boolean;
|
||||
function LoadStringFromStream (const AStream: TStream): String;
|
||||
var lenX: Integer;
|
||||
begin
|
||||
@ -2061,42 +2193,7 @@ Writeln('DB: ' + datMod.dbName);
|
||||
{$ENDIF}
|
||||
|
||||
{$IFDEF CUSTOM_CTRL_Rootvin}
|
||||
// arrDefs.Add('tbl_hdc_ph_Log');
|
||||
arrDefs.Add('ep_hdcdzapi_GetKusovnik');
|
||||
arrDefs.Add('col_TabDokladyZbozi_EXT');
|
||||
arrDefs.Add('col_TabStavSkladu_EXT');
|
||||
arrDefs.Add('col_TabVazbyPrikazu_EXT');
|
||||
arrDefs.Add('col_TabPrPostup_EXT');
|
||||
arrDefs.Add('col_TabPohybyZbozi_EXT');
|
||||
arrDefs.Add('col_TabEvidRozpracOperR_EXT');
|
||||
arrDefs.Add('col_TabKmenZbozi_EXT');
|
||||
arrDefs.Add('ef_GetDatumASmenu');
|
||||
arrDefs.Add('tbl_hdc_PZ_PuvodniVC');
|
||||
arrDefs.Add('tbl_TabVyrobaTestoVyroba');
|
||||
arrDefs.Add('tbl_TabVyrobaObjednavky');
|
||||
arrDefs.Add('tbl_TabVyrobaOperaceStartStop');
|
||||
arrDefs.Add('tbl_TabVyrobaOperaceStartStopVydej');
|
||||
arrDefs.Add('ep_Vyroba_InsertEvidRozpracOper');
|
||||
arrDefs.Add('ep_Vyroba_InsertEvidRozpracOperPol');
|
||||
arrDefs.Add('ep_Vyroba_DoplnSkladProVydejDleDokladu');
|
||||
arrDefs.Add('ep_Vyroba_GenOdvodZeMzdy');
|
||||
arrDefs.Add('ep_Vyroba_GenVydejZeMzdy');
|
||||
arrDefs.Add('ep_Vyroba_Doklady_Micharna');
|
||||
|
||||
arrDefs.Add('ep_P03_HDC1');
|
||||
arrDefs.Add('ep_P03');
|
||||
arrDefs.Add('ep_P01_HDC1');
|
||||
// arrDefs.Add('ep_P01_HDCDZApi1');
|
||||
arrDefs.Add('ep_P01');
|
||||
arrDefs.Add('ep_V03_HDC1');
|
||||
arrDefs.Add('ep_V03');
|
||||
// arrDefs.Add('');
|
||||
|
||||
arrDefs.Add('trg__TabPohybyZbozi_HDC_D');
|
||||
arrDefs.Add('trg__TabPohybyZbozi_HDC_IU');
|
||||
arrDefs.Add('trg__hdc_PZ_PuvodniVC_D');
|
||||
arrDefs.Add('trg__TabVyrCisPrikaz_HDC_D');
|
||||
arrDefs.Add('trg__TabVyrobaOperaceStartStop_D');
|
||||
{$I ./_custom/Rootvin/winSvc_zdroje.inc}
|
||||
{$ENDIF}
|
||||
|
||||
{$IFDEF CUSTOM_CTRL_INCOSystems}
|
||||
@ -2105,10 +2202,12 @@ Writeln('DB: ' + datMod.dbName);
|
||||
if (iTemp>-1) then
|
||||
arrDefs.Delete(iTemp);
|
||||
|
||||
arrDefs.Add('tbl_hdc_ph_PrijataJsonData_rozsireni');
|
||||
arrDefs.Add('col_TabPredna_EXT');
|
||||
arrDefs.Add('col_TabKmenZbozi_EXT');
|
||||
arrDefs.Add('col_TabPrPostup_EXT');
|
||||
arrDefs.Add('col_TabEvidRozpracOper_EXT');
|
||||
arrDefs.Add('ef_Vyroba_EvidROpR_MamNeuzavrenouPredchozi');
|
||||
arrDefs.Add('ep_Vyroba_InsertEvidRozpracOper');
|
||||
arrDefs.Add('ep_Vyroba_InsertEvidRozpracOperPol');
|
||||
arrDefs.Add('ep_Vyroba_GenOdvodZeMzdy');
|
||||
@ -2116,6 +2215,7 @@ Writeln('DB: ' + datMod.dbName);
|
||||
arrDefs.Add('ep_HDCDZApi_ZpracujPrijataData');
|
||||
{$ENDIF}
|
||||
|
||||
|
||||
{$IFDEF CUSTOM_CTRL_Gornicky}
|
||||
iTemp:= arrDefs.IndexOf('ep_HDCDZApi_ZpracujPrijataData');
|
||||
if (iTemp>-1) then
|
||||
@ -2123,10 +2223,28 @@ Writeln('DB: ' + datMod.dbName);
|
||||
{$I '_custom/Gornicky/sqlDefs.inc'}
|
||||
{$ENDIF}
|
||||
|
||||
|
||||
{$IFDEF CUSTOM_CTRL_Westra}
|
||||
iTemp:= arrDefs.IndexOf('ep_HDCDZApi_ZpracujPrijataData');
|
||||
if (iTemp>-1) then
|
||||
arrDefs.Delete(iTemp);
|
||||
{$I '_custom/Westra/sqlDefs.inc'}
|
||||
{$ENDIF}
|
||||
|
||||
|
||||
{$IFDEF CUSTOM_CTRL_EMPolar}
|
||||
iTemp:= arrDefs.IndexOf('ep_HDCDZApi_ZpracujPrijataData');
|
||||
if (iTemp>-1) then
|
||||
arrDefs.Delete(iTemp);
|
||||
{$I '_custom/EMPolar/sqlDefs.inc'}
|
||||
{$ENDIF}
|
||||
|
||||
|
||||
{$IFDEF CUSTOM_CTRL_Metalcasting}
|
||||
arrDefs.Add('col_TabDokumenty_DokladProAPI');
|
||||
{$ENDIF}
|
||||
|
||||
|
||||
errMsg:= 'Nacitani SQL definici...';
|
||||
datMod.LogInfo (Quick.Logger.etInfo, errMsg);
|
||||
{$IFDEF DEBUG}
|
||||
@ -2156,7 +2274,12 @@ Writeln('DB: ' + datMod.dbName);
|
||||
objectNazev:= LeftStr(lSQL, lSQL.IndexOf(Chr(13))).Replace('-- ', '');
|
||||
|
||||
|
||||
if (srcNazev.StartsWith('ep_', true)) or (srcNazev.StartsWith('ef_', true)) or (srcNazev.StartsWith('trg_')) then
|
||||
if (srcNazev.StartsWith('ep_', true))
|
||||
or (srcNazev.StartsWith('bp_', true))
|
||||
or (srcNazev.StartsWith('ef_', true))
|
||||
or (srcNazev.StartsWith('hpx_', true))
|
||||
or (srcNazev.StartsWith('epx_', true))
|
||||
or (srcNazev.StartsWith('trg_', true)) then
|
||||
begin
|
||||
canCont:= false;
|
||||
hash1:= '';
|
||||
@ -2189,10 +2312,16 @@ Writeln('DB: ' + datMod.dbName);
|
||||
Continue;
|
||||
|
||||
|
||||
if (srcNazev.StartsWith('ep_')) then
|
||||
if (srcNazev.StartsWith('ep_')) or (srcNazev.StartsWith('bp_')) then
|
||||
begin
|
||||
datMod.sqlConn.ExecSQL('DROP PROCEDURE IF EXISTS dbo.' + srcNazev);
|
||||
datMod.LogInfo (Quick.Logger.etInfo, 'Pregenerovani procedury: ' + srcNazev);
|
||||
canCont3:= true;
|
||||
if (srcNazev.StartsWith('bp_')) and not(srcNazev.ToUpper.Contains('HDC')) then
|
||||
canCont3:= false;
|
||||
if (canCont3) then
|
||||
begin
|
||||
datMod.sqlConn.ExecSQL('DROP PROCEDURE IF EXISTS dbo.' + srcNazev);
|
||||
datMod.LogInfo (Quick.Logger.etInfo, 'Pregenerovani procedury: ' + srcNazev);
|
||||
end;
|
||||
end;
|
||||
|
||||
if (srcNazev.StartsWith('ef_')) then
|
||||
@ -2564,7 +2693,24 @@ ShellExecute(0, 'open', PChar(url), nil, nil, SW_SHOWNORMAL);
|
||||
if (datMod.sqlConn.Connected) and (iCanStart) then
|
||||
begin
|
||||
try
|
||||
fServer.Active:= true;
|
||||
try
|
||||
fServer.Active:= true;
|
||||
except
|
||||
on E: Exception do
|
||||
begin
|
||||
OutputDebugString(PChar(E.ClassName + ' - ' + E.Message));
|
||||
raise;
|
||||
end;
|
||||
on E: EIdCouldNotBindSocket do
|
||||
begin
|
||||
if E.InnerException is EIdSocketError then
|
||||
OutputDebugString(PChar(
|
||||
'WSAError: ' +
|
||||
IntToStr(EIdSocketError(E.InnerException).LastError)
|
||||
));
|
||||
raise;
|
||||
end;
|
||||
end;
|
||||
SQLKontroly;
|
||||
|
||||
mamTabPrijataData:= datMod.SQLTableExists(tblPrijataJsonData);
|
||||
@ -2592,6 +2738,17 @@ ShellExecute(0, 'open', PChar(url), nil, nil, SW_SHOWNORMAL);
|
||||
{$I ./_custom/Gornicky/winSvc/mainSvcStart.inc}
|
||||
{$ENDIF}
|
||||
|
||||
{$IFDEF CUSTOM_CTRL_Westra}
|
||||
{$I ./_custom/Westra/winSvc/mainSvcStart.inc}
|
||||
{$ENDIF}
|
||||
|
||||
{$IFDEF CUSTOM_CTRL_EMPolar}
|
||||
{$I ./_custom/EMPolar/winSvc/mainSvcStart.inc}
|
||||
{$ENDIF}
|
||||
|
||||
{$IFDEF CUSTOM_CTRL_Rootvin}
|
||||
{$I ./_custom/Rootvin/winSvc/mainSvcStart.inc}
|
||||
{$ENDIF}
|
||||
|
||||
datMod.LogInfo (Quick.Logger.etInfo, 'Start sluzby zpracovani prijatych JSON zprav (interval ' + intProcessDZTasksSec.ToString + ' ' + sTemp + ')');
|
||||
zpracJsonThr:= THeoZpracujJSONThread.Create (ThreadTerminated);
|
||||
@ -2647,6 +2804,8 @@ ShellExecute(0, 'open', PChar(url), nil, nil, SW_SHOWNORMAL);
|
||||
|
||||
procedure THDCDZApiService.ThreadTerminated (Sender: TObject);
|
||||
begin
|
||||
ServiceThread.Terminate;
|
||||
Controller(SERVICE_CONTROL_STOP);
|
||||
if (Sender is TThread) then
|
||||
(Sender as TThread).ForceQueue(nil, Sender.Free);
|
||||
end;
|
||||
@ -2727,6 +2886,17 @@ ShellExecute(0, 'open', PChar(url), nil, nil, SW_SHOWNORMAL);
|
||||
{$I ./_custom/Gornicky/winSvc/mainSvcStop.inc}
|
||||
{$ENDIF}
|
||||
|
||||
{$IFDEF CUSTOM_CTRL_Westra}
|
||||
{$I ./_custom/Westra/winSvc/mainSvcStop.inc}
|
||||
{$ENDIF}
|
||||
|
||||
{$IFDEF CUSTOM_CTRL_EMPolar}
|
||||
{$I ./_custom/EMPolar/winSvc/mainSvcStop.inc}
|
||||
{$ENDIF}
|
||||
|
||||
{$IFDEF CUSTOM_CTRL_Rootvin}
|
||||
{$I ./_custom/Rootvin/winSvc/mainSvcStop.inc}
|
||||
{$ENDIF}
|
||||
|
||||
if Assigned(licThr) then
|
||||
begin
|
||||
|
||||
Reference in New Issue
Block a user