Skip to content

Commit

Permalink
run pre-commit all
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeoconnor0308 committed Jan 17, 2025
1 parent 420e151 commit af4890e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions examples/cached_decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

cache = RedisCache(namespace="main", client=redis.Redis(), serializer=PickleSerializer())

@cached(
cache, ttl=10, key_builder=lambda *args, **kw: "key")

@cached(cache, ttl=10, key_builder=lambda *args, **kw: "key")
async def cached_call():
return Result("content", 200)

Expand Down
1 change: 1 addition & 0 deletions examples/frameworks/aiohttp_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

cache = SimpleMemoryCache(serializer=JsonSerializer())


@cached(cache=cache, key_builder=lambda x: "time")
async def time():
return {"time": datetime.now().isoformat()}
Expand Down
2 changes: 1 addition & 1 deletion examples/frameworks/sanic_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
app = Sanic(__name__)


@cached(SimpleMemoryCache(), key_builder = lambda x :"my_custom_key")
@cached(SimpleMemoryCache(), key_builder=lambda x: "my_custom_key")
async def expensive_call():
logger.info("Expensive has been called")
await asyncio.sleep(3)
Expand Down
2 changes: 1 addition & 1 deletion examples/frameworks/tornado_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class MainHandler(tornado.web.RequestHandler):

# Due some incompatibilities between tornado and asyncio, caches can't use the "ttl" feature
# in order to make it work, you will have to specify it always to 0
@cached(SimpleMemoryCache(serializer=JsonSerializer, timeout=0), key_builder= lambda x : "my_custom_key")
@cached(SimpleMemoryCache(serializer=JsonSerializer, timeout=0), key_builder=lambda x: "my_custom_key")
async def time(self):
return {"time": datetime.now().isoformat()}

Expand Down

0 comments on commit af4890e

Please sign in to comment.