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

hacky conditional scheduled tasks #294

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

jmbrunskill
Copy link
Collaborator

@jmbrunskill jmbrunskill commented Jul 4, 2024

πŸ‘©πŸ»β€πŸ’» What does this PR do?

Allows the user to create a conditional notification trigger as part of the schedule using a tera template.

πŸ§ͺ How has/should this change been tested?

Needs some more testing I think. if someone created a template that included false and true that would potentially be weird but also maybe that's just their fault.

πŸ’Œ Any notes for the reviewer?

I think the big gap here is probably some kind of alert condition state that we need to store.
Otherwise we could just keep alerting on the same condition.

Should this be a different mechanism that just a tera template, is a specific query a better thing?

Maybe it should be a different notification type to the scheduled ones?

Copy link

github-actions bot commented Jul 4, 2024

Bundle size difference

Comparing this PR to main

Old size New size Diff
5.2 MB 5.2 MB 1023 B (0.02%)

@jmbrunskill jmbrunskill marked this pull request as ready for review July 4, 2024 02:55
@@ -68,6 +72,17 @@ impl ScheduledNotificationPluginConfig {
// Then add the duration to the schedule_start_time until we're past now

match self.schedule_frequency.as_str() {
"hourly" => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sounds like the use case we're looking at first will be daily backups. So we could drop hourly if we think it could cause problems..

@EthanMcQ-TMF
Copy link
Collaborator

In the realm of hacky solutions, in theory couldn't we put a conditional on a recipients query so the notification only has recipients when it needs to be sent out?

@jmbrunskill
Copy link
Collaborator Author

In the realm of hacky solutions, in theory couldn't we put a conditional on a recipients query so the notification only has recipients when it needs to be sent out?

That is a nice hacky idea, might give it a try...

@jmbrunskill
Copy link
Collaborator Author

@EthanMcQ-TMF in your opinion what would be needed to make it less hacky?

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.

2 participants