Complete self-destruct support
This commit is contained in:
parent
5eb6157c1b
commit
c1231245a4
4 changed files with 61 additions and 3 deletions
22
tasks.py
22
tasks.py
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue