ソースを参照

need to force the encoding with aiomysql

Ludovic Gasc (GMLudo) 9 年 前
コミット
24bfe67abb

+ 2 - 0
frameworks/Python/asyncio/aiohttp.web/hello/__init__.py

@@ -70,6 +70,8 @@ class Container(api_hour.Container):
                 minsize=int(self.config['engines']['mysql']['minsize']),
                 maxsize=int(self.config['engines']['mysql']['maxsize']),
                 cursorclass=aiomysql.DictCursor,
+                charset='utf8',
+                use_unicode=True,
                 loop=self.loop))
         yield from asyncio.wait([self.engines['pg']], return_when=asyncio.ALL_COMPLETED)
         self.engines['redis'] = yield from asyncio_redis.Pool.create(host=self.config['engines']['redis']['host'],

+ 1 - 0
frameworks/Python/asyncio/benchmark_config.json

@@ -47,6 +47,7 @@
       "setup_file": "aiohttp.web/setup",
       "db_url": "/db_mysql",
       "query_url": "/queries_mysql?queries=",
+      "fortune_url": "/fortunes_mysql",
       "update_url": "/updates_mysql?queries=",
       "port": 8080,
       "approach": "Realistic",