Skip to content

Commit 2b791fc

Browse files
committed
Rename ttl to expiry to enhance readability
1 parent 55368ea commit 2b791fc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

coc/client.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ def dispatch(self, event_name, *args, **kwargs):
206206
else:
207207
event(*args, **kwargs)
208208

209-
def set_cache(self, *cache_to_edit, max_size=128, ttl=None):
209+
def set_cache(self, *cache_to_edit, max_size=128, expiry=None):
210210
"""Set the max size and expiry time for a cached object.
211211
212212
.. note::
@@ -217,15 +217,15 @@ def set_cache(self, *cache_to_edit, max_size=128, ttl=None):
217217
218218
:param cache_to_edit: :class:`str` or :class:`CacheType` enum. The name of cache type to change.
219219
:param max_size: :class:`int` The max size of the created cache. Defaults to 128
220-
:param ttl: :class:`int` The expiry time in seconds of the cache. Defaults to None (cache does not expire)
220+
:param expiry: :class:`int` The expiry time in seconds of the cache. Defaults to None (cache does not expire)
221221
"""
222222
for cache_type in cache_to_edit:
223223
if not getattr(self, cache_type):
224224
raise ValueError('{} is not a valid cached data class type'.format(cache_to_edit))
225225

226-
cache = Cache(max_size=max_size, ttl=ttl)
226+
cache = Cache(max_size=max_size, ttl=expiry)
227227
log.debug('Cache type %s has been set with max size %s and expiry %s seconds',
228-
cache_type, max_size, ttl)
228+
cache_type, max_size, expiry)
229229
setattr(Client, cache_type, cache)
230230

231231
async def search_clans(self, *, name: str=None, war_frequency: str=None,

0 commit comments

Comments
 (0)