r/FastAPI • • Apr 03 '22

Question Manage background activity

Hey guys.

I am creating an FastAPI application that is collecting user data in the background 24/7 and saving it to the DB.

I was wondering:

How would I go about implementing something like this in a multi-worker environemnt? Because I don't want the data collection task to run in every process, but I also need to access the data throughout the API.

3 Upvotes

10 comments sorted by

View all comments

Show parent comments

1

u/jackstar_12 Apr 05 '22

Its a next.js frontend. But I assume that doesn't matter in this case? It is not running 24/7 on client, if thats what you thought.

1

u/heyorm Apr 05 '22

Oh, that was indeed what I understood you to mean. Thanks for clarifying.