Skip to content

Commit

Permalink
Bump aiohttp from 3.8.6 to 3.9.0 (#780)
Browse files Browse the repository at this point in the history
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sam Bull <git@sambull.org>
  • Loading branch information
dependabot[bot] and Dreamsorcerer committed Nov 24, 2023
1 parent 92b1032 commit 75da099
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-e .

aiomcache==0.8.1
aiohttp==3.8.6
aiohttp==3.9.0
marshmallow==3.20.1
msgpack==1.0.7
pytest==7.4.3
Expand Down
13 changes: 8 additions & 5 deletions tests/performance/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,25 @@ async def close(self, *_):
await self.cache.close()


async def handler_get(req):
cache_key = web.AppKey("cache_key", CacheManager)


async def handler_get(req: web.Request) -> web.Response:
try:
data = await req.app["cache"].get("testkey")
data = await req.app[cache_key].get("testkey")
if data:
return web.Response(text=data)
except asyncio.TimeoutError:
return web.Response(status=404)

data = str(uuid.uuid4())
await req.app["cache"].set("testkey", data)
await req.app[cache_key].set("testkey", data)
return web.Response(text=str(data))


def run_server(backend: str) -> None:
app = web.Application()
app["cache"] = CacheManager(backend)
app.on_shutdown.append(app["cache"].close)
app[cache_key] = CacheManager(backend)
app.on_shutdown.append(app[cache_key].close)
app.router.add_route("GET", "/", handler_get)
web.run_app(app)

0 comments on commit 75da099

Please sign in to comment.