Skip to content

Commit

Permalink
fix(AdminController)
Browse files Browse the repository at this point in the history
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
  • Loading branch information
marcelklehr committed Feb 29, 2024
1 parent f200192 commit 1f2e30f
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions lib/Controller/AdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\JSONResponse;
use OCP\AppFramework\QueryException;
use OCP\AppFramework\Services\IAppConfig;
use OCP\BackgroundJob\IJobList;
use OCP\DB\Exception;
use OCP\Exceptions\AppConfigTypeConflictException;
use OCP\IBinaryFinder;
use OCP\IRequest;

Expand Down Expand Up @@ -271,9 +273,13 @@ public function gputensorflow(): JSONResponse {
}

public function cron(): JSONResponse {
/** @var IAppConfig $appConfig */
$appConfig = \OC::$server->getRegisteredAppContainer('core')->get(IAppConfig::class);
$cron = $appConfig->getAppValueString('backgroundjobs_mode', '');
try {
/** @var IAppConfig $appConfig */
$appConfig = \OC::$server->getRegisteredAppContainer('core')->get(IAppConfig::class);
$cron = $appConfig->getAppValueString('backgroundjobs_mode', '');
} catch (QueryException|AppConfigTypeConflictException $e) {
new JSONResponse([], Http::STATUS_INTERNAL_SERVER_ERROR);
}
return new JSONResponse(['cron' => $cron]);
}

Expand Down

1 comment on commit 1f2e30f

@baka0815
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marcelklehr
That was fast, working now, thanks!

Please sign in to comment.