python - 重新启动 Bottle 应用程序(以编程方式)

标签 python database-connection bottle restart peewee

如何以编程方式重新启动 Bottle 应用程序?

def error_handler(error):
    if error.message == "connection already closed":
        RESTART_BOTTLE_SERVER()  # This will reacquire connection

最佳答案

您可以使用this answer中描述的方法停止 Bottle 应用程序(线程)。 .

关于python - 重新启动 Bottle 应用程序(以编程方式),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30318184/

相关文章:

Python bottle 进程到达超时连接

python - 如何在 Pandas 中用数字对字符串进行排序?

android - 在手机上直接从 github 运行 python 代码

java - MS SQL Server 2005 Express x86 - 其端口无法访问 - 帮助

java - 无法连接到 Oracle 数据库 : java. sql.SQLRecoverableException

sql-server - 防火墙1433端口未打开

Python csv阅读器: how to pipe output to another script using command line

python - 使用 Python 绘制蝴蝶曲线

python - 在python Bottle中接收JSON

python - 无法让 Bottle 在 Elastic Beanstalk 上运行