From 0aeb87b697fe20edadde0f38847b0449073e9d1a Mon Sep 17 00:00:00 2001 From: Francois Lesueur Date: Fri, 25 Oct 2024 15:45:19 +0200 Subject: [PATCH] add gss.updatels.interval config --- README.md | 3 +++ lib/BackgroundJobs/UpdateLookupServer.php | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 09e2668..fd51f8a 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,9 @@ Config parameters to operate the server in slave mode: // url of the master, so we can redirect the user back in case of an error 'gss.master.url' => 'http://localhost/nextcloud2', + +// interval (in seconds) between lookup-server updates +'gss.updatels.interval' => 86400, ```` The Slave will always redirect not logged in user to the master to perform the login. diff --git a/lib/BackgroundJobs/UpdateLookupServer.php b/lib/BackgroundJobs/UpdateLookupServer.php index e629d3b..5dec946 100644 --- a/lib/BackgroundJobs/UpdateLookupServer.php +++ b/lib/BackgroundJobs/UpdateLookupServer.php @@ -29,18 +29,20 @@ use OCP\AppFramework\Utility\ITimeFactory; use OCP\BackgroundJob\IJob; use OCP\BackgroundJob\TimedJob; +use OCP\IConfig; class UpdateLookupServer extends TimedJob { public function __construct( ITimeFactory $time, + IConfig $config, private GlobalSiteSelector $globalSiteSelector, private Slave $slave ) { parent::__construct($time); - $this->setInterval(86400); + $this->setInterval($config->getSystemValueInt('gss.updatels.interval', 86400)); $this->setTimeSensitivity(IJob::TIME_SENSITIVE); }