From 2234497c49b3e529721852313ff7005949bc01d1 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Wed, 28 Jun 2023 15:14:41 +0200 Subject: [PATCH] TaskMapper#update: Use time factory Signed-off-by: Marcel Klehr (cherry picked from commit 1623ad9eda5fed298b798d5cac0012a3a0af8bda) --- lib/private/LanguageModel/Db/TaskMapper.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/private/LanguageModel/Db/TaskMapper.php b/lib/private/LanguageModel/Db/TaskMapper.php index e0b06a1b62b..f15187d61d5 100644 --- a/lib/private/LanguageModel/Db/TaskMapper.php +++ b/lib/private/LanguageModel/Db/TaskMapper.php @@ -6,6 +6,7 @@ use OCP\AppFramework\Db\DoesNotExistException; use OCP\AppFramework\Db\Entity; use OCP\AppFramework\Db\MultipleObjectsReturnedException; use OCP\AppFramework\Db\QBMapper; +use OCP\AppFramework\Utility\ITimeFactory; use OCP\DB\Exception; use OCP\IDBConnection; @@ -13,7 +14,10 @@ use OCP\IDBConnection; * @extends QBMapper */ class TaskMapper extends QBMapper { - public function __construct(IDBConnection $db) { + public function __construct( + IDBConnection $db, + private ITimeFactory $timeFactory, + ) { parent::__construct($db, 'llm_tasks', Task::class); } @@ -45,7 +49,7 @@ class TaskMapper extends QBMapper { } public function update(Entity $entity): Entity { - $entity->setLastUpdated(time()); + $entity->setLastUpdated($this->timeFactory->now()->getTimestamp()); return parent::update($entity); } } -- 2.39.5