]> source.dussan.org Git - nextcloud-server.git/commitdiff
TaskMapper#update: Use time factory
authorMarcel Klehr <mklehr@gmx.net>
Wed, 28 Jun 2023 13:14:41 +0000 (15:14 +0200)
committerMarcel Klehr <mklehr@gmx.net>
Wed, 9 Aug 2023 08:01:12 +0000 (10:01 +0200)
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
(cherry picked from commit 1623ad9eda5fed298b798d5cac0012a3a0af8bda)

lib/private/LanguageModel/Db/TaskMapper.php

index e0b06a1b62b3f20693ffa438ce032fb06aac8adc..f15187d61d5233d570cb579181b7e3573af5255a 100644 (file)
@@ -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<Task>
  */
 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);
        }
 }