【问题标题】:peewee azure functions avoid MySQL server has gone awaypeewee azure 功能避免 MySQL 服务器已经消失
【发布时间】:2021-03-21 10:28:35
【问题描述】:

您知道在使用基于消耗付费的 Azure Functions 时避免 MySQL Server 消失的 peewee 错误的最佳做法是什么吗?可能有一个最佳实践来调用 db.connect() / db.close() 就像这里为其他框架描述的那样http://docs.peewee-orm.com/en/latest/peewee/database.html#framework-integration

错误时有发生,并且无法真正预测。

感谢您的帮助和问候

【问题讨论】:

    标签: azure-functions peewee


    【解决方案1】:

    MySQL 有一个超时会终止空闲连接——我猜这就是问题所在。您可以尝试使用reconnect mixin,它会在某些错误情况下处理自动重新连接尝试。

    【讨论】:

      猜你喜欢
      • 2016-03-06
      • 1970-01-01
      • 2011-06-07
      • 2010-12-20
      • 2017-01-21
      • 2015-01-15
      • 2017-04-02
      • 2011-11-09
      相关资源
      最近更新 更多