Skip to content
Open
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Known providers:

More details on how to set this up in the [admin docs](https://docs.nextcloud.com/server/latest/admin_manual/ai/index.html)
]]> </description>
<version>3.4.1</version>
<version>3.5.0-dev.1</version>
<licence>agpl</licence>
<author>Julien Veyssier</author>
<namespace>Assistant</namespace>
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"html2text/html2text": "^4.3",
"phpoffice/phpword": "^1.2",
"ralouphie/mimey": "^1.0",
"simshaun/recurr": "^5.0",
"smalot/pdfparser": "^2.11"
},
"scripts": {
Expand Down
275 changes: 274 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 38 additions & 0 deletions lib/BackgroundJob/RunAssignmentsJob.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php

declare(strict_types=1);

/**
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

namespace OCA\Assistant\BackgroundJob;

use OCA\Assistant\Service\AssignmentsService;
use OCA\Assistant\Service\InternalException;
use OCA\Assistant\Service\UnauthorizedException;
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\BackgroundJob\TimedJob;
use Psr\Log\LoggerInterface;

class RunAssignmentsJob extends TimedJob {
public function __construct(
ITimeFactory $timeFactory,
private AssignmentsService $assignmentService,
private LoggerInterface $logger,
) {
parent::__construct($timeFactory);
$this->setAllowParallelRuns(true);
Comment thread
marcelklehr marked this conversation as resolved.
$this->setTimeSensitivity(self::TIME_SENSITIVE);
$this->setInterval(60 * 10); // 10min
}
public function run($argument) {
$userId = $argument['userId'];
try {
$this->assignmentService->runDueAssignmentsForUser($userId);
} catch (InternalException|UnauthorizedException $e) {
$this->logger->error('Error running assignments for user ' . $userId, ['exception' => $e]);
}
}
}
Loading
Loading