Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions apps/api/plane/settings/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,9 @@
# issue version tasks
"plane.bgtasks.issue_version_sync",
"plane.bgtasks.issue_description_version_sync",
# background tasks
"plane.bgtasks.logger_task",
"plane.bgtasks.webhook_task",
)

FILE_SIZE_LIMIT = int(os.environ.get("FILE_SIZE_LIMIT", 5242880))
Expand Down
25 changes: 25 additions & 0 deletions apps/api/plane/tests/unit/settings/test_celery_imports.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright (c) 2023-present Plane Software, Inc. and contributors
# SPDX-License-Identifier: AGPL-3.0-only
# See the LICENSE file for details.

"""
Unit tests for Celery task imports configuration.
"""

import pytest
from django.conf import settings
from celery import current_app


@pytest.mark.unit
class TestCeleryImports:
def test_celery_imports_contains_logger_and_webhook_tasks(self):
assert "plane.bgtasks.logger_task" in settings.CELERY_IMPORTS
assert "plane.bgtasks.webhook_task" in settings.CELERY_IMPORTS

def test_logger_and_webhook_tasks_are_registered(self):
# Force celery to import registered modules
current_app.loader.import_default_modules()

assert "plane.bgtasks.logger_task.process_logs" in current_app.tasks
assert "plane.bgtasks.webhook_task.webhook_send_task" in current_app.tasks