Skip to content

Commit

Permalink
add gss.updatels.interval config
Browse files Browse the repository at this point in the history
  • Loading branch information
flesueur committed Oct 25, 2024
1 parent d36ae2d commit 0aeb87b
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 @@ -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.
Expand Down
4 changes: 3 additions & 1 deletion lib/BackgroundJobs/UpdateLookupServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 0aeb87b

Please sign in to comment.