From 1c3e0a01f4b89866191643dfd6182e68e3dea54c Mon Sep 17 00:00:00 2001 From: "Fabian P. Schmidt" Date: Sun, 29 Dec 2019 23:34:51 +0100 Subject: [PATCH] docs: Add section on how-to run celery tasks manually Signed-off-by: Fabian P. Schmidt --- docs/developer-guide.rst | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/docs/developer-guide.rst b/docs/developer-guide.rst index 68bece8..4545cbe 100644 --- a/docs/developer-guide.rst +++ b/docs/developer-guide.rst @@ -80,6 +80,27 @@ In order to simulate an heartbeat of the stations 7, 23 and 42, the following co $ docker-compose exec web django-admin update_station_last_seen 7 23 42 +Manually run a celery tasks +--------------------------- + +The following procedure can be used to manually run celery tasks in the local (docker-based) development environment: + +- Setup local dev env (docker). +- Start django shell + ``` + docker-compose exec web django-admin shell + ``` +- Run an asnyc task and check if it succeeded. + ``` + > from network.base.tasks import update_all_tle + > task = update_all_tle.delay() + > assert(task.ready()) + ``` +- (optional) Check the celery log for the task output: + ``` + docker-compose logs celery + ``` + Coding Style ------------