erich.wanker Posted September 13, 2023 Share Posted September 13, 2023 Hi, a uniGui App on IIS with Hyperserver does not start the daily task correctly- what i need for importing data every 24 hours How i use the UniThreadTimer: on Servermodule - i have a uniThreadTimer with intervall 2000000 (0,5 hours) procedure TUniServerModule.UniThreadTimer1Timer( Sender : TObject ); begin disconnect_to_my_mysql_database; connect_to_my_mysql_database; read_last_sync_date_in_table_settings; if last_sync_date <> actual_date then begin UniThreadTimer1.Lock; .. do my things UniThreadTimer1.unLock; end; end; Any Idea why this not work correctly? ThanX for help Erich Quote Link to comment Share on other sites More sharing options...
Hayri ASLAN Posted September 14, 2023 Share Posted September 14, 2023 Hi, Hyper server and persistent node zero. Persistent Node Zero Persistent Node Zero is a Node with Id = zero (0) and it is guaranteed to run continuously, i.e. it will never be permanently unloaded. However, it will be occasionally recycled like any other Node. Again, it is guaranteed that it will be reloaded immediately after it is recycled. Main purpose of a Persistent Node is to make sure that you have at least one Node running at a time. Consider a scenario where your uniGUI application should perform a background task in a thread, possibly in a TUniThreadTimer placed on a ServerModule. In a classical uniGUI app there is only one process, so your background task is guaranteed to run in form of a Singleton. However, in HyperServer where multiple copies of same process are running concurrently, there should be a mechanism to ensure your Singleton method will run only in one of the Nodes. Persistent Node Zero option perfectly serves this purpose. All you need to do is enabled this option and checking Node Id in your uniGUI application. If boolean property in ServerModule named NodeZero is True, then it is safe to run your background task. Quote Link to comment Share on other sites More sharing options...
erich.wanker Posted September 14, 2023 Author Share Posted September 14, 2023 Hy and ThanX for Infos... i will try: In Delphi: if NodeZero then begin in CFG-File: persistent_node_zero=1 nice greetings Erich Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.