简体   繁体   中英

get djcelery periodic task data inside the django app and keep the data in the entire application without store in file and db?

I am getting the polling data by running celery beat scheduler and periodic task. I like to share this data with the Django server. this data should available for the entire Django application server. is there anyway? and I don't want to share this data either DB or file. please suggest me to do this in a better way, thank you in advance.

Short answer : what you ask for is not possible, period.

Longer answer : given that a django production setup will run more than one Django process (yes, even with one single server), there's no such thing as "THE" django server and the only way to "share data" from celery workers to the django processes is to store them in "something" that is 1/ available to all the workers and all the django processes and 2/ supports concurrent access - IOW in a database server process of some sort (your SQL db for persistant data, Redis for transiant data).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM