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

Naming background scheduler jobs #305

Merged
merged 1 commit into from
Jun 29, 2021

Conversation

JeffAshton
Copy link
Contributor

@JeffAshton JeffAshton commented Jun 29, 2021

Naming background scheduler jobs so logs are more informative.

@@ -1056,6 +1056,7 @@ def init_rule(self, new_rule, new=True):
args=[new_rule],
seconds=new_rule['run_every'].total_seconds(),
id=new_rule['name'],
name="Rule: %s" % (new_rule['name']),
Copy link
Contributor Author

@JeffAshton JeffAshton Jun 29, 2021

Choose a reason for hiding this comment

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

The name is used in log messages. Without the name, the messages currently look like:

WARNING:apscheduler.scheduler:Execution of job "ElastAlerter.handle_rule_execution (trigger: interval[0:00:10], next run at: 2021-06-29 13:21:11 UTC)" skipped: maximum number of running instances reached (1)

But with the name they look like:

WARNING:apscheduler.scheduler:Execution of job "Rule: Errors (trigger: interval[0:00:10], next run at: 2021-06-29 09:28:25 EDT)" skipped: maximum number of running instances reached (1)

@jertel jertel merged commit 3e34751 into jertel:master Jun 29, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants