From 673b937d3d64f8814eb14e7e345e1fce189c77d5 Mon Sep 17 00:00:00 2001 From: yggverse Date: Fri, 19 Jul 2024 21:51:47 +0300 Subject: [PATCH] record history on background process --- src/Entity/Browser/Container/Page.php | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/Entity/Browser/Container/Page.php b/src/Entity/Browser/Container/Page.php index 8bd4576a..d2515d6b 100644 --- a/src/Entity/Browser/Container/Page.php +++ b/src/Entity/Browser/Container/Page.php @@ -244,11 +244,18 @@ class Page $this->navbar->request->getValue() ); - // Save request in database - $this->container->browser->database->renewHistory( - $this->navbar->request->getValue(), - $this->title->getValue() - ); + // Save request in database (on background) + $pid = pcntl_fork(); + + if ($pid === 0) + { + $this->container->browser->database->renewHistory( + $this->navbar->request->getValue(), + $this->title->getValue() + ); + + exit; + } } // Stop