Complete self-destruct support

This commit is contained in:
Thomas Sileo 2022-09-11 10:51:08 +02:00
parent 5eb6157c1b
commit c1231245a4
4 changed files with 61 additions and 3 deletions

View file

@ -271,6 +271,28 @@ def move_to(ctx, moved_to):
asyncio.run(_send_move())
@task
def self_destruct(ctx):
# type: (Context) -> None
from loguru import logger
from app.boxes import send_self_destruct
from app.database import async_session
logger.disable("app")
async def _send_self_destruct():
if input("Initiating self destruct, type yes to confirm: ") != "yes":
print("Aborting")
async with async_session() as db_session:
await send_self_destruct(db_session)
print("Done")
asyncio.run(_send_self_destruct())
@task
def yunohost_config(
ctx,