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

ext: add celery signals ep #91

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

Conversation

jrcastro2
Copy link

@jrcastro2 jrcastro2 force-pushed the add-celery-signales-ep branch from 623c886 to 0d43f63 Compare March 26, 2025 19:10
@jrcastro2 jrcastro2 requested a review from Copilot March 27, 2025 08:32
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for registering Celery signals via entry points, addressing the referenced issue.

  • Introduces a new method load_celery_signals, which imports modules for signal registration
  • Modifies init_app to set the logger level to DEBUG and load the signals

@@ -34,10 +34,18 @@ def __init__(self, app=None, **kwargs):
def init_app(self, app, entry_point_group="invenio_celery.tasks", **kwargs):
"""Initialize application object."""
self.init_config(app)
app.logger.setLevel("DEBUG")
Copy link
Preview

Copilot AI Mar 27, 2025

Choose a reason for hiding this comment

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

[nitpick] Setting the logger level to DEBUG directly here might override the application's logging configuration unexpectedly. Consider conditionally setting the logging level for development or making this configurable.

Suggested change
app.logger.setLevel("DEBUG")
log_level = app.config.get("LOG_LEVEL", "WARNING")
app.logger.setLevel(log_level)

Copilot is powered by AI, so mistakes are possible. Review output carefully before use.

def load_celery_signals(self):
"""Load Celery signals."""
# Import Celery signals via entry points
for ep in pkg_resources.iter_entry_points("invenio_celery.signals"):
Copy link
Author

Choose a reason for hiding this comment

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

I addded this to have a common place where the signals are registered, it could also be done in each repo if we prefer - instead of using an entry point

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.

Job report
1 participant