문제

I'm integrating the uWSGI spooler into my system. The uWSGI spooler is a task queue that works by writing the task files to a specific directory and then background processes take those files one by one, process them and finally delete them. I want to be able to save the task file entry into a database. So everytime a task file is written to the specified directory, I want to be able to put an entry into the DB as well and as soon as the task is processed, I want to mark that process as complete in the DB. How should I go about it?

도움이 되었습니까?

해결책

Write the db record at the start of the spooler function (in the function itself), update it before the function returns. (eventually you can write a handy decorator for it)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top