fetch_posts: add KeyboardInterrupt handling
This commit is contained in:
parent
4ba3bb1662
commit
a3348602c1
|
@ -206,7 +206,11 @@ async def amain():
|
||||||
async with PostFetcher(config=config) as fetcher: await fetcher.fetch_all()
|
async with PostFetcher(config=config) as fetcher: await fetcher.fetch_all()
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
try:
|
||||||
anyio.run(amain)
|
anyio.run(amain)
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
# suppress the lengthy traceback
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
|
|
Loading…
Reference in New Issue