Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expire federation jobs #5923

Merged
merged 8 commits into from
Aug 2, 2017
Merged

Expire federation jobs #5923

merged 8 commits into from
Aug 2, 2017

Conversation

schiessle
Copy link
Member

After trying for 30 days to create a trusted server relationship without success we kill the background job.

Might also prevent things like: #5880

schiessle and others added 6 commits August 1, 2017 10:07
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
…re the other server will decline and the background job will be removed

Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
* Inject the timefacotry so we can mock it properly in the tests.
* Extended unit tests to cover the new paths

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
@codecov
Copy link

codecov bot commented Aug 1, 2017

Codecov Report

Merging #5923 into master will increase coverage by 0.04%.
The diff coverage is 78.15%.

@@             Coverage Diff             @@
##             master   #5923      +/-   ##
===========================================
+ Coverage     53.06%   53.1%   +0.04%     
+ Complexity    22761   22757       -4     
===========================================
  Files          1404    1404              
  Lines         88064   88112      +48     
  Branches       1327    1327              
===========================================
+ Hits          46730   46795      +65     
+ Misses        41334   41317      -17
Impacted Files Coverage Δ Complexity Δ
.../federation/lib/Middleware/AddServerMiddleware.php 86.66% <ø> (ø) 4 <0> (ø) ⬇️
...s/federation/lib/Controller/SettingsController.php 80% <ø> (ø) 7 <0> (ø) ⬇️
apps/federation/lib/DAV/FedAuth.php 87.5% <0%> (ø) 3 <1> (ø) ⬇️
apps/federation/lib/TrustedServers.php 98.52% <100%> (+0.04%) 23 <0> (ø) ⬇️
...eration/lib/Command/SyncFederationAddressBooks.php 31.57% <100%> (ø) 6 <1> (ø) ⬇️
...federation/lib/Controller/OCSAuthAPIController.php 69.64% <50%> (-1.79%) 10 <0> (ø)
apps/federation/lib/SyncJob.php 50% <60%> (+27.77%) 3 <3> (-2) ⬇️
...deration/lib/BackgroundJob/RequestSharedSecret.php 66.23% <77.14%> (+15.48%) 17 <2> (-2) ⬇️
...s/federation/lib/BackgroundJob/GetSharedSecret.php 63.33% <77.14%> (+13.95%) 19 <2> (-3) ⬇️
apps/federation/lib/AppInfo/Application.php 66.66% <80%> (+28.07%) 10 <1> (ø) ⬇️
... and 17 more

Copy link
Member

@rullzer rullzer left a comment

Choose a reason for hiding this comment

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

Fine by me.

But maybe we should also make it a timed job. So that we try at most once an hour or so? => Future work

@@ -74,7 +75,8 @@ private function registerService() {
$server->getJobList(),
$server->getSecureRandom(),
$server->getConfig(),
$server->getEventDispatcher()
$server->getEventDispatcher(),
$server->query(ITimeFactory::class)
Copy link
Member

Choose a reason for hiding this comment

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

It should work without this.
I will try it.

Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Joas Schilling <coding@schilljs.com>
@nickvergessen
Copy link
Member

Cleaned it up a bit, works 👍

@nickvergessen nickvergessen added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels Aug 2, 2017
@rullzer rullzer merged commit fbfd371 into master Aug 2, 2017
@rullzer rullzer deleted the expire-federation-jobs branch August 2, 2017 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4. to release Ready to be released and/or waiting for tests to finish enhancement feature: federation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants