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

Send notification content through Firebase and add an Arq scheduler #613

Open
wants to merge 113 commits into
base: main
Choose a base branch
from

Conversation

foucblg
Copy link
Contributor

@foucblg foucblg commented Oct 29, 2024

No description provided.

@foucblg foucblg force-pushed the Notification-final-branch branch 3 times, most recently from e9e646b to 07a5ce5 Compare November 17, 2024 04:49
@armanddidierjean armanddidierjean marked this pull request as draft November 17, 2024 08:06
app/core/endpoints_core.py Show resolved Hide resolved
app/types/scheduler.py Outdated Show resolved Hide resolved
app/types/scheduler.py Outdated Show resolved Hide resolved
app/types/scheduler.py Outdated Show resolved Hide resolved
app/utils/communication/future_notifications.py Outdated Show resolved Hide resolved
app/worker.py Outdated Show resolved Hide resolved
app/worker.py Outdated Show resolved Hide resolved
Copy link

codecov bot commented Nov 17, 2024

Codecov Report

Attention: Patch coverage is 53.26087% with 86 lines in your changes missing coverage. Please review.

Project coverage is 80.99%. Comparing base (66e7531) to head (a0ce052).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
app/types/scheduler.py 45.94% 40 Missing ⚠️
app/utils/communication/notifications.py 55.81% 19 Missing ⚠️
app/core/notification/endpoints_notification.py 56.25% 7 Missing ⚠️
app/app.py 14.28% 6 Missing ⚠️
app/modules/ph/endpoints_ph.py 16.66% 5 Missing ⚠️
app/dependencies.py 57.14% 3 Missing ⚠️
app/utils/tools.py 57.14% 3 Missing ⚠️
app/modules/cinema/endpoints_cinema.py 50.00% 1 Missing ⚠️
app/modules/loan/endpoints_loan.py 91.66% 1 Missing ⚠️
app/types/exceptions.py 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #613      +/-   ##
==========================================
- Coverage   81.31%   80.99%   -0.33%     
==========================================
  Files         129      130       +1     
  Lines       10013    10116     +103     
==========================================
+ Hits         8142     8193      +51     
- Misses       1871     1923      +52     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@foucblg foucblg added the ready for review This PR is ready to be reviewed label Nov 20, 2024
@foucblg foucblg marked this pull request as ready for review November 25, 2024 12:30
armanddidierjean

This comment was marked as resolved.

Copy link
Member

@armanddidierjean armanddidierjean left a comment

Choose a reason for hiding this comment

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

We should add a test that tries to defer a method using the scheduler

app/core/endpoints_core.py Outdated Show resolved Hide resolved
app/dependencies.py Outdated Show resolved Hide resolved
app/modules/advert/endpoints_advert.py Outdated Show resolved Hide resolved
app/modules/ph/endpoints_ph.py Show resolved Hide resolved
app/types/scheduler.py Outdated Show resolved Hide resolved
app/types/scheduler.py Outdated Show resolved Hide resolved
app/dependencies.py Outdated Show resolved Hide resolved
app/modules/loan/endpoints_loan.py Outdated Show resolved Hide resolved
app/types/scheduler.py Outdated Show resolved Hide resolved
)
scheduler_logger.debug(f"Job {job_id} queued {job}")

async def queue_job_defer_to(
Copy link
Member

Choose a reason for hiding this comment

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

Is there a real interest in keeping both queue_job_time_defer and queue_job_defer_to?
I think we are likely to calculate defer_seconds using a timedelta and datetime, and thus could easily use queue_job_defer_to instead.

It seems Arq will calculate a datetime in both cases, so there shouldn't be a performance gain from using a method or the other.

I would think only having one method will reduce code complexity and limit potentials mistakes

@armanddidierjean armanddidierjean changed the title Notification final branch Send notification content through Firebase and add an Arq scheduler Dec 3, 2024
@Daihecyy Daihecyy added wontfix This will not be worked on and removed wontfix This will not be worked on labels Dec 3, 2024
@Rotheem Rotheem force-pushed the Notification-final-branch branch 2 times, most recently from 06188e2 to 2002603 Compare December 4, 2024 12:03
@Rotheem Rotheem force-pushed the Notification-final-branch branch from 4cadc2f to 0eb2466 Compare December 4, 2024 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request notifications ready for review This PR is ready to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants