feat(bot): ✨ Add "Delete My Activity Data" button to p.me.
This commit is contained in:
@@ -6,7 +6,7 @@ import click
|
||||
|
||||
from procs import flush_messages
|
||||
|
||||
from payphone.db import setup
|
||||
from payphone.db import setup, models
|
||||
from payphone.core import logging
|
||||
|
||||
|
||||
@@ -30,7 +30,21 @@ async def main():
|
||||
@main.command()
|
||||
@coroutine
|
||||
async def flush():
|
||||
await flush_messages.flush()
|
||||
"""Flush all messages in Redis to the database. Runs every 5 seconds."""
|
||||
|
||||
while True:
|
||||
await flush_messages.flush()
|
||||
await asyncio.sleep(5)
|
||||
|
||||
|
||||
@main.command()
|
||||
@coroutine
|
||||
async def delete_accounts():
|
||||
"""Delete all accounts that were scheduled for deletion. Runs every 1 hour."""
|
||||
|
||||
while True:
|
||||
await models.User.filter(is_deleting=True).delete()
|
||||
await asyncio.sleep(60 * 60)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user