You are not logged in.
Pages: 1
Try TSynBackgroundThreadProcess
Offline
I'm trying to come up with a solution for this (by the way, the updated documentation link is now https://synopse.info/files/html/api-1.1 … ADPROCESS).
Do anybody have some sample code that allows to program task to run at a *specific* time every day?
Offline
Just use a TSynBackgroundTimer https://synopse.info/files/html/api-1.1 … ROUNDTIMER - mORMot 2 it is located in mormot.core.threads.pas.
With a resolution of 1 minute for instance, then a local field with the next trigerring time, and if current time is >= than this time, run the task and update the trigerring time.
Offline
Scheduler from the now-disappeared-but-has-a-backup-on-github CromisLibrary is the best for such a task as far as I know.
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
The CromisLibrary scheduler seems to use the Windows or LCL timer. So it is not very suitable for a daemon/server with no main loop.
What is wrong with:
FNextTrigger: TDateTime;
...
procedure TMyProcessingClass.RunEveryMinute(
...
if NowUtc > FNextTrigger then
begin
DoSomething();
FNextTrigger := FNextTrigger + 1; // see U tomorrow
end;
Offline
The CromisLibrary scheduler seems to use the Windows or LCL timer. So it is not very suitable for a daemon/server with no main loop.
Actually Cromis Scheduler uses a separated thread to perform the loop:
https://github.com/CPsoftBE/BackupOfCro … .pas#L1048
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
Pages: 1