log-forward: cache the result of $LogForwardFilterLogForwarding

Looks like the function is called for every message to match otherwise. 😳
This commit is contained in:
Christian Hesse 2023-01-20 11:15:55 +01:00
parent 2294ac77a8
commit 072d349473
1 changed files with 2 additions and 1 deletions

View File

@ -47,8 +47,9 @@ $ScriptLock $0;
:local MessageVal;
:local MessageDups ({});
:local LogForwardFilterLogForwardingCached [ $EitherOr [ $LogForwardFilterLogForwarding ] ("\$^") ];
:foreach Message in=[ /log/find where (!(message="") and \
!(message~[ $EitherOr [ $LogForwardFilterLogForwarding ] ("\$^") ]) and \
!(message~$LogForwardFilterLogForwardingCached) and \
!(topics~$LogForwardFilter) and !(message~$LogForwardFilterMessage)) or \
topics~$LogForwardInclude or message~$LogForwardIncludeMessage ] do={
:set MessageVal [ /log/get $Message ];