Skip to content

Commit 71bf6f9

Browse files
committed
fix(Assignments): Minor fixes to get things to run
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
1 parent 882d471 commit 71bf6f9

7 files changed

Lines changed: 11 additions & 6 deletions

File tree

appinfo/info.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Known providers:
6262
6363
More details on how to set this up in the [admin docs](https://docs.nextcloud.com/server/latest/admin_manual/ai/index.html)
6464
]]> </description>
65-
<version>3.4.1</version>
65+
<version>3.5.0-dev.1</version>
6666
<licence>agpl</licence>
6767
<author>Julien Veyssier</author>
6868
<namespace>Assistant</namespace>

lib/BackgroundJob/RunAssignmentsJob.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function __construct(
2424
parent::__construct($timeFactory);
2525
$this->setAllowParallelRuns(true);
2626
$this->setTimeSensitivity(self::TIME_SENSITIVE);
27-
$this->setInterval(60 * 10); // 10min
27+
$this->setInterval(60); // 1min
2828
}
2929
public function run($argument) {
3030
$userId = $argument['userId'];

lib/Controller/AssignmentsApiController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
namespace OCA\Assistant\Controller;
99

1010
use OCA\Assistant\Db\Assignment;
11-
use OCA\Assistant\Db\ChattyLLM\AssignmentMapper;
11+
use OCA\Assistant\Db\AssignmentMapper;
1212
use OCA\Assistant\ResponseDefinitions;
1313
use OCA\Assistant\Service\AssignmentsService;
1414
use OCA\Assistant\Service\InternalException;

lib/Db/AssignmentMapper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* SPDX-License-Identifier: AGPL-3.0-or-later
88
*/
99

10-
namespace OCA\Assistant\Db\ChattyLLM;
10+
namespace OCA\Assistant\Db;
1111

1212
use OCA\Assistant\Db\Assignment;
1313
use OCP\AppFramework\Db\DoesNotExistException;

lib/Db/ChattyLLM/Session.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class Session extends Entity implements \JsonSerializable {
8686
'summary',
8787
'isSummaryUpToDate',
8888
'isRemembered',
89-
'assignment_id'
89+
'assignmentId'
9090
];
9191

9292
public function __construct() {

lib/Migration/Version030500Date20260430083738.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt
6666
}
6767
if ($schema->hasTable('assistant_chat_sns')) {
6868
$schemaChanged = true;
69+
$table = $schema->getTable('assistant_chat_sns');
6970
$table->addColumn('assignment_id', Types::BIGINT, [
7071
'notnull' => false,
7172
]);

lib/Service/AssignmentsService.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
use OCA\Assistant\BackgroundJob\RunAssignmentsJob;
1313
use OCA\Assistant\Db\Assignment;
14-
use OCA\Assistant\Db\ChattyLLM\AssignmentMapper;
14+
use OCA\Assistant\Db\AssignmentMapper;
1515
use OCA\Assistant\Db\ChattyLLM\Message;
1616
use OCA\Assistant\Db\ChattyLLM\SessionMapper;
1717
use OCP\AppFramework\Db\DoesNotExistException;
@@ -41,10 +41,14 @@ public function createAssignment(?string $userId, string $prompt, int $startsAt,
4141
if ($userId === null) {
4242
throw new UnauthorizedException();
4343
}
44+
$now = $this->timeFactory->now()->getTimestamp();
4445
$assignment = new Assignment();
4546
$assignment->setUserId($userId);
4647
$assignment->setPrompt($prompt);
4748
$assignment->setStartsAt($startsAt);
49+
$assignment->setLastRunAt(0);
50+
$assignment->setCreatedAt($now);
51+
$assignment->setUpdatedAt($now);
4852
try {
4953
$assignment->setRecurrence($recurrence);
5054
} catch (\InvalidArgumentException $e) {

0 commit comments

Comments
 (0)