]> git.mxchange.org Git - friendica.git/commitdiff
Don't compute system.update_interval when it's -1 (disabled)
authorHypolite Petovan <hypolite@mrpetovan.com>
Mon, 19 Dec 2022 15:05:21 +0000 (10:05 -0500)
committerHypolite Petovan <hypolite@mrpetovan.com>
Mon, 19 Dec 2022 15:05:21 +0000 (10:05 -0500)
- Address part of https://github.com/friendica/friendica/issues/12011#issuecomment-1357768936

src/Module/Update/Display.php

index 4b84cba7a82bce91dae06941bfb59d863c960ffa..9f149d7dc861f08caa8f89cbaab30c786263fae1 100644 (file)
@@ -59,9 +59,9 @@ class Display extends DisplayModule
                $parentUriId = $item['parent-uri-id'];
 
                if (empty($force)) {
-                       $browserUpdate = $this->pConfig->get($profileUid, 'system', 'update_interval');
-                       if (!empty($browserUpdate)) {
-                               $updateDate = date(DateTimeFormat::MYSQL, time() - (intval($browserUpdate) / 500));
+                       $browserUpdate = intval($this->pConfig->get($profileUid, 'system', 'update_interval') ?? 40000);
+                       if ($browserUpdate >= 1000) {
+                               $updateDate = date(DateTimeFormat::MYSQL, time() - ($browserUpdate * 2 / 1000));
                                if (!Post::exists([
                                        "`parent-uri-id` = ? AND `uid` IN (?, ?) AND `received` > ?",
                                        $parentUriId, 0,