]> git.wh0rd.org - tt-rss.git/blobdiff - include/functions.php
try to send digests within 2 hours of preferred time only
[tt-rss.git] / include / functions.php
index 9eb66de3ea3fcd3d5637b0e450f1da55a19b465a..0ef1d013fe7b4a5f086eec7600eca38af90f49d4 100644 (file)
                        if (get_pref($link, 'DIGEST_ENABLE', $line['id'], false)) {
                                $preferred_ts = strtotime(get_pref($link, 'DIGEST_PREFERRED_TIME', $line['id'], '00:00'));
 
-                               if ($preferred_ts && time() >= $preferred_ts) {
+                               // try to send digests within 2 hours of preferred time
+                               if ($preferred_ts && time() >= $preferred_ts &&
+                                               time() - $preferred_ts <= 7200) {
 
                                        if ($debug) print "Sending digest for UID:" . $line['id'] . " - " . $line["email"] . " ... ";