Skip to content

Commit

Permalink
Update Celery configuration file
Browse files Browse the repository at this point in the history
  • Loading branch information
lafrech committed Nov 25, 2024
1 parent f55152d commit 4e934e1
Showing 1 changed file with 11 additions and 18 deletions.
29 changes: 11 additions & 18 deletions source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -212,24 +212,17 @@ Scheduled Tasks
BEMServer uses `Celery`_ to manage asynchronous tasks. It needs workers to
execute tasks, and another process, called beat, to trigger scheduled tasks.

Like BEMServer API, the configuration is split into the BEMServer Core part and
the BEMServer Celery part. Configuration of BEMServer Celery is also achieved
with a Python file provided by an environment variable.

This split avoids duplication of BEMServer Core parameters by allowing the use
of the same configuration file for all applications using BEMServerCore
(BEMServer API, BEMServer Celery,...).

Create a Celery configuration file (e.g. bemserver-celery-settings.py). It
should contain the scheduling parameters of the services to run::

beat_schedule = {
"service_id": { # Unique identifier of your choice
"task": "ServiceName", # Task name of the service
"schedule": 3600, # Scheduling interval in seconds
"args": (arg_1, args_2), # Task arguments
"kwargs": {"kwarg": val} # Task keyword arguments
},
The configuration is included in the BEMServer Core configuration file::

CELERY_CONFIG = {
"beat_schedule": {
"service_id": { # Unique identifier of your choice
"task": "ServiceName", # Task name of the service
"schedule": 3600, # Scheduling interval in seconds
"args": (arg_1, args_2), # Task arguments
"kwargs": {"kwarg": val} # Task keyword arguments
},
}
}

For details about how to define entries in the schedule, see
Expand Down

0 comments on commit 4e934e1

Please sign in to comment.