From 335424a8c3454700e686786b645baf14f10d0ad4 Mon Sep 17 00:00:00 2001 From: yggverse Date: Sun, 14 Apr 2024 22:19:54 +0300 Subject: [PATCH] update history settings folding --- config.json | 11 ++++------- src/Entity/Tab/Page.php | 8 ++++---- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/config.json b/config.json index 827641e..d41134d 100644 --- a/config.json +++ b/config.json @@ -78,16 +78,13 @@ } } }, - "memory": + "history": { - "history": + "memory": { "enabled":true - } - }, - "database": - { - "history": + }, + "database": { "enabled":true, "timeout":null diff --git a/src/Entity/Tab/Page.php b/src/Entity/Tab/Page.php index 8015a6f..7415aa6 100644 --- a/src/Entity/Tab/Page.php +++ b/src/Entity/Tab/Page.php @@ -46,10 +46,10 @@ class Page $this->history = new \Yggverse\Yoda\Model\History; // Run database cleaner - if ($this->config->database->history->timeout) + if ($this->config->history->database->timeout) { $this->app->database->cleanHistory( - $this->config->database->history->timeout + $this->config->history->database->timeout ); } @@ -372,7 +372,7 @@ class Page ); // Update history in memory pool - if ($history && $this->config->memory->history->enabled && $url != $this->history->getCurrent()) + if ($history && $this->config->history->memory->enabled && $url != $this->history->getCurrent()) { $this->history->add( $url @@ -603,7 +603,7 @@ class Page ); // Update history database - if ($history && $this->config->database->history->enabled) + if ($history && $this->config->history->database->enabled) { // Ignore history record on same URL stored if ($result = $this->app->database->getHistory('', 0, 1))