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

Check destinations before forking #616

Merged
merged 4 commits into from
Apr 19, 2023
Merged

Conversation

hmpf
Copy link
Contributor

@hmpf hmpf commented Apr 17, 2023

The code now only forks a new process if there is anything to send.

Note: The functions in argus/notificationprofile/media/__init__.py has been sorted differently since the actual sending functions are parameters to the filter-function and therefore must come before it.

Other problems I found:

  1. the sending apparatus expects a list of destinations while the plugins themselves expects a queryset
  2. the filtering done inside each plugin.send should be on the base-class and not overriden. Then the base class controls whether it wants a queryset or a list of destinations.

@codecov-commenter
Copy link

codecov-commenter commented Apr 17, 2023

Codecov Report

Merging #616 (6c1b8cd) into master (2b2a172) will increase coverage by 0.04%.
The diff coverage is 80.55%.

@@            Coverage Diff             @@
##           master     #616      +/-   ##
==========================================
+ Coverage   82.04%   82.08%   +0.04%     
==========================================
  Files          73       73              
  Lines        3531     3539       +8     
==========================================
+ Hits         2897     2905       +8     
  Misses        634      634              
Impacted Files Coverage Δ
src/argus/incident/signals.py 81.08% <71.42%> (-0.74%) ⬇️
src/argus/notificationprofile/media/__init__.py 78.33% <82.75%> (+3.33%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@github-actions
Copy link

github-actions bot commented Apr 17, 2023

Test results

       7 files     462 suites   26m 46s ⏱️
   348 tests    347 ✔️ 1 💤 0
2 436 runs  2 429 ✔️ 7 💤 0

Results for commit 6c1b8cd.

♻️ This comment has been updated with latest results.

Copy link
Member

@lunkwill42 lunkwill42 left a comment

Choose a reason for hiding this comment

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

With #618 applied, this works. It's still not superfast, but that's mostly the fault of the bulk endpoint itself...

@hmpf hmpf marked this pull request as ready for review April 19, 2023 10:56
@hmpf hmpf force-pushed the check-dests-before-fork branch from dc4e344 to 71b5f0d Compare April 19, 2023 11:11
@hmpf hmpf force-pushed the check-dests-before-fork branch from 71b5f0d to aca690f Compare April 19, 2023 11:15
@hmpf hmpf requested a review from johannaengland April 19, 2023 11:16
Copy link
Contributor

@johannaengland johannaengland left a comment

Choose a reason for hiding this comment

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

You marked my suggestion in the find destination test as resolved, but without any comment or changes

@hmpf
Copy link
Contributor Author

hmpf commented Apr 19, 2023

You marked my suggestion in the find destination test as resolved, but without any comment or changes

It seems my commit via github didn't take, seems to have worked when I tried just now. You might not be allowed to review anymore...

@hmpf hmpf force-pushed the check-dests-before-fork branch from 49c2f13 to 6c1b8cd Compare April 19, 2023 12:04
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 6 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@hmpf hmpf merged commit da43f44 into Uninett:master Apr 19, 2023
@hmpf hmpf deleted the check-dests-before-fork branch April 19, 2023 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Check if notification needs be sent *before* making a new process to send it
4 participants