N
N
Nurlybek2021-07-21 16:14:09
Django
Nurlybek, 2021-07-21 16:14:09

How to make shared data in Celery?

There is data that is "cached" in a dict in django applications. How to run several workers, so that everyone does not make their own copy of these caches, and everyone uses the same one?
I start in the standard way. But in current cases, the application and each worker has its own copy.
celery --app=config worker -B --loglevel=info

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2021-07-21
@Nurlybek

No way. Celery tasks run as separate processes, and each process has its own address space.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question