summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMarcel Klehr <mklehr@gmx.net>2023-06-28 15:14:41 +0200
committerMarcel Klehr <mklehr@gmx.net>2023-08-09 10:01:12 +0200
commit2234497c49b3e529721852313ff7005949bc01d1 (patch)
treec8472aa04f004ced71e6d521ed81c05c28da53ed /lib
parent91325efa7808bd54c15950fdb0a1efc866aea79e (diff)
downloadnextcloud-server-2234497c49b3e529721852313ff7005949bc01d1.tar.gz
nextcloud-server-2234497c49b3e529721852313ff7005949bc01d1.zip
TaskMapper#update: Use time factory
Signed-off-by: Marcel Klehr <mklehr@gmx.net> (cherry picked from commit 1623ad9eda5fed298b798d5cac0012a3a0af8bda)
Diffstat (limited to 'lib')
-rw-r--r--lib/private/LanguageModel/Db/TaskMapper.php8
1 files 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<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);
}
}