Jump to content

Service / HyperServer / NodeZero : need to Restart Service


Abaksoft

Recommended Posts

Hi Farshad,

I have an application deployed as Service / Hyperserver (Build 1549) wich works fine.

This application use an  UniThreadTimer1 wich do something  on background task,  (NodeZero)   (Without Browser opened) like this :

procedure TUniServerModule.UniThreadTimer1Timer(Sender: TObject);
begin
  UniThreadTimer1.Lock;
  try
  //==============
     if NodeZero then
     begin
       DoSomething;
     end;
  //==============

  finally
    UniThreadTimer1.Release;
  end;

end;

 

All works fine. 

However, when I deploy a new release to my customer (as usually we do :    192.168.1.11:8077/server)   the new DoSomething requires to  Stop  / Restart  the Service  again

Which is unfortunate, because we are losing this fabulous deployment option.  

 

Fore info :

The UniThreadTimer1 is not enabled at Designtime.

 I tried to started it on both :  once on   ServerStartup  and  once on  Create   but without suscces. I have to Stop and Restart the Service after deploy.

:

procedure TUniServerModule.UniGUIServerModuleServerStartup(Sender: TObject);
begin
  UniThreadTimer1.Enabled:=True;
end;

 

procedure TUniServerModule.UniGUIServerModuleCreate(Sender: TObject);
begin
  UniThreadTimer1.Enabled:=True;
end;

 

What do you think ?

Thx.

Link to comment
Share on other sites

Dear Farshad,

After investigation, it seems that the   Remote Deployment, can't refresh a Thread,

With  uniapplication as :  Service / HyperServer  (NodeZero or without NodeZero).

(Build 1549)

 

Test : 

1. Build a small UniApplication (32 bits or 64 bits)  :   Put just  an UniTreadTimer1 on ServerModule  for doing something.

procedure TUniServerModule.UniThreadTimer1Timer(Sender: TObject);
begin
 
  UniThreadTimer1.Lock;
  try
  //==============
    DoSomething;
  //==============

  finally
    UniThreadTimer1.Release;
  end;

end;

 

2. Install it and Start HyperServer....

 

3. Upload a new release of this Uniapplication  (DoSomething2)   via Remote Deployment

image.png.85b9a8f00d93bf57c476c637130dcf69.png

 

3. Result :  no effect  (no update)  !

Solution :   if we Stop/Restart  HyperServer (cmd command)  that run the new update.

Do I do something wrong ?

 

Link to comment
Share on other sites

Dear Farshad,

Sorry for the Alert.  That works fine.

I had two problem :    The Node creation    and   the  DB Connexion.

I forgot that on HyperServer each Node is creat on Server Creat  and not on ServerStartUp Event.


procedure TUniServerModule.UniGUIServerModuleCreate(Sender: TObject);
begin
//1.
  My_Connexion:=TIBCConnection.Create(Nil);

//2.
  Connexion;

//3.
  UniThreadTimer1.Enabled:=True;
end;



procedure TUniServerModule.UniGUIServerModuleDestroy(Sender: TObject);
begin
//1.
  UniThreadTimer1.enabled:=False;

//2.
  FreeAndNil(My_Connexion);
end;

 

After tha all is well done.

Sorry again...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...