Skip to content

Commit

Permalink
Merge pull request #165 from Worteks/master
Browse files Browse the repository at this point in the history
Add gss.updatels.interval config to tune the interval between lookup-server updates
  • Loading branch information
ArtificialOwl authored Feb 17, 2025
2 parents f915426 + 2ccb041 commit 9b1d533
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,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.
Expand Down
4 changes: 3 additions & 1 deletion lib/BackgroundJobs/UpdateLookupServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,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);
}

Expand Down

0 comments on commit 9b1d533

Please sign in to comment.