feat(bot): ✨ Improve the startup script.
This commit is contained in:
@@ -1,8 +1,5 @@
|
||||
from datetime import datetime, timezone
|
||||
|
||||
import tortoise
|
||||
|
||||
from payphone.db import models
|
||||
from payphone.core import config
|
||||
|
||||
|
||||
@@ -10,8 +7,3 @@ async def init() -> None:
|
||||
"""Initialize the database and it's connections."""
|
||||
|
||||
await tortoise.Tortoise.init(config.TORTOISE_ORM, use_tz=True)
|
||||
|
||||
await tortoise.Tortoise.generate_schemas(safe=True)
|
||||
|
||||
await models.Call.filter(ended_at=None).update(ended_at=datetime.now(timezone.utc))
|
||||
await models.Channel.exclude(call_id=None).update(call_id=None)
|
||||
|
||||
Reference in New Issue
Block a user