mirror of
https://git.sr.ht/~tsileo/microblog.pub
synced 2025-06-05 21:59:23 +02:00
Complete self-destruct support
This commit is contained in:
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,
|
||||
|
Reference in New Issue
Block a user