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

Skip disabled users and do not break the cronjob on the first unsent email #842

Merged
merged 4 commits into from
Mar 10, 2020

Conversation

VicDeo
Copy link
Member

@VicDeo VicDeo commented Mar 9, 2020

@VicDeo VicDeo added this to the development milestone Mar 9, 2020
@VicDeo VicDeo self-assigned this Mar 9, 2020
@codecov
Copy link

codecov bot commented Mar 9, 2020

Codecov Report

Merging #842 into master will decrease coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #842      +/-   ##
============================================
- Coverage     84.38%   84.37%   -0.01%     
+ Complexity      507      504       -3     
============================================
  Files            47       47              
  Lines          1896     1895       -1     
============================================
- Hits           1600     1599       -1     
  Misses          296      296              
Impacted Files Coverage Δ Complexity Δ
lib/BackgroundJob/EmailNotification.php 100.00% <100.00%> (ø) 13.00 <0.00> (-3.00)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1ea3cab...ec9e611. Read the comment docs.

@VicDeo VicDeo changed the title [WIP] Skip disabled users and do not break the cronjob on the first unsent email Mar 10, 2020
@@ -144,10 +142,14 @@ protected function runStep($limit, $sendTime) {
$this->mqHandler->sendEmailToUser($uid, $user['email'], $language, $timezone, $sendTime);
$sentMailForUsers[] = $uid;
} catch (\Exception $e) {
// Run cleanup before we die
$this->mqHandler->deleteSentItems($sentMailForUsers, $sendTime);
// Throw the exception again - which gets logged by core and the job is handled appropriately
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is the cleanup not needed anymore?

Copy link
Member Author

Choose a reason for hiding this comment

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

we don't rethrow exception any more which means that we always reach the line 155 now
https://github.com/owncloud/activity/pull/842/files#diff-35fc1857b1cf16ed158a97c77089f80cL155

Copy link
Contributor

Choose a reason for hiding this comment

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

ok, didn't see that,
👍

@micbar
Copy link
Contributor

micbar commented Mar 10, 2020

One question. Rest looking fine

Copy link
Contributor

@micbar micbar left a comment

Choose a reason for hiding this comment

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

LGTM

@micbar
Copy link
Contributor

micbar commented Mar 10, 2020

Coverage is miscalculating

@VicDeo Can I merge now and override?

@HanaGemela HanaGemela mentioned this pull request Mar 10, 2020
31 tasks
@micbar micbar changed the base branch from master to release-2.5.3 March 10, 2020 10:53
@micbar micbar changed the base branch from release-2.5.3 to master March 10, 2020 10:54
@micbar micbar merged commit a825057 into master Mar 10, 2020
@delete-merged-branch delete-merged-branch bot deleted the bugfix/840 branch March 10, 2020 10:55
@micbar micbar modified the milestones: development, QA Mar 10, 2020
@davitol davitol mentioned this pull request Mar 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants