本文介绍了如何在uwsgi停止时执行一个函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用瓶和uwsgi ..在某些时候,我需要知道什么时候uwsgi停止或当我的应用程序(Flask)对象被销毁,当它发生时,执行一个函数。
任何想法?

解决方案

您可以使用python atexit模块或uwsgi.atexit钩子

i am using flask and uwsgi.. At some point i need to know when uwsgi is stopped or when my app (Flask) object is destroyed and when it happens, execute a function.Any ideas ??Please

解决方案

you can use the python atexit module or the uwsgi.atexit hook

这篇关于如何在uwsgi停止时执行一个函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-18 19:36