sanic extensions

awaesome

redis

  • sanic-redis-extension(官方文档)
    • release版本是2018年的(截止20220415)
    • 问题
      • 使用sanic 2.21.3版本会提示不兼容的错误

      AttributeError: Setting variables on Sanic instances is not allowed. You should change your Sanic instance to use instance.ctx.extensions
      instead.

    • redis配置参数不支持timeout设置

      config = {
      "address": connection_uri,
      "db": self.get_from_app_config(app, 'REDIS_DATABASE', None),
      "password": self.get_from_app_config(app, 'REDIS_PASSWORD', None),
      "ssl": self.get_from_app_config(app, 'REDIS_SSL', None),
      "encoding": self.get_from_app_config(app, 'REDIS_ENCODING', None),
      "minsize": self.get_from_app_config(app, 'REDIS_MIN_SIZE_POOL', 1),
      "maxsize": self.get_from_app_config(app, 'REDIS_MAX_SIZE_POOL', 10),
      }

  • sanic-redis
    • release版本2021年(截止20220415)
    • 连接方式基于url,参数列表

      URL_QUERY_ARGUMENT_PARSERS = {
      "db": int,
      "socket_timeout": float,
      "socket_connect_timeout": float,
      "socket_keepalive": bool,
      "retry_on_timeout": bool,
      "max_connections": int,
      "health_check_interval": int,
      "ssl_check_hostname": bool,
      }

sanic-session

posted @   春树&暮云  阅读(241)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 单元测试从入门到精通
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 上周热点回顾(3.3-3.9)
· winform 绘制太阳,地球,月球 运作规律
点击右上角即可分享
微信分享提示