forked from LBRYCommunity/lbry-sdk
remove unused import and dead code
This commit is contained in:
parent
16a2023bbd
commit
4e09b35012
2 changed files with 0 additions and 16 deletions
|
@ -1,6 +1,5 @@
|
||||||
import asyncio
|
import asyncio
|
||||||
import ipaddress
|
import ipaddress
|
||||||
import time
|
|
||||||
import typing
|
import typing
|
||||||
import logging
|
import logging
|
||||||
import binascii
|
import binascii
|
||||||
|
|
|
@ -131,21 +131,6 @@ def json_dumps_pretty(obj, **kwargs):
|
||||||
return json.dumps(obj, sort_keys=True, indent=2, separators=(',', ': '), **kwargs)
|
return json.dumps(obj, sort_keys=True, indent=2, separators=(',', ': '), **kwargs)
|
||||||
|
|
||||||
|
|
||||||
def cancel_task(task: typing.Optional[asyncio.Task]):
|
|
||||||
if task and not task.done():
|
|
||||||
task.cancel()
|
|
||||||
|
|
||||||
|
|
||||||
def cancel_tasks(tasks: typing.List[typing.Optional[asyncio.Task]]):
|
|
||||||
for task in tasks:
|
|
||||||
cancel_task(task)
|
|
||||||
|
|
||||||
|
|
||||||
def drain_tasks(tasks: typing.List[typing.Optional[asyncio.Task]]):
|
|
||||||
while tasks:
|
|
||||||
cancel_task(tasks.pop())
|
|
||||||
|
|
||||||
|
|
||||||
def async_timed_cache(duration: int):
|
def async_timed_cache(duration: int):
|
||||||
def wrapper(func):
|
def wrapper(func):
|
||||||
cache: typing.Dict[typing.Tuple,
|
cache: typing.Dict[typing.Tuple,
|
||||||
|
|
Loading…
Reference in a new issue