diff options
author | Christian Hesse <mail@eworm.de> | 2022-05-17 21:11:03 +0200 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2022-05-17 21:11:03 +0200 |
commit | 3139b14c67d2aacdba4001795c299283f9de5ebd (patch) | |
tree | a6ba69f136df404bc1583375c98697604eabd4d7 /global-functions | |
parent | 8c31a06b39fbb8c103a9f9e63be56f1bf47d914c (diff) |
global-functions: $FlushEmailQueue: return if time is not synced
The local system time is used in the mail header. We do not want the
mails to be sent in the past, so return early (and thus wait for time
being synced).
Diffstat (limited to 'global-functions')
-rw-r--r-- | global-functions | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/global-functions b/global-functions index 51c87bc..713a284 100644 --- a/global-functions +++ b/global-functions @@ -344,10 +344,16 @@ :global EitherOr; :global LogPrintExit2; + :global TimeIsSync; :local AllDone true; :local QueueLen [ :len $EmailQueue ]; + :if ([ $TimeIsSync ] = false) do={ + $LogPrintExit2 debug $0 ("Time is not synced, not flushing.") false; + :return false; + } + :if ([ :len [ /system/scheduler/find where name="FlushEmailQueue" ] ] > 0 && $QueueLen = 0) do={ $LogPrintExit2 warning $0 ("Flushing E-Mail messages from scheduler, but queue is empty.") false; } |