fix: Bugs created after the overhaul, performance and layout fixes
This commit is contained in:
@@ -27,7 +27,7 @@ from crm.quotations_router import router as crm_quotations_router
|
||||
from crm.nextcloud import close_client as close_nextcloud_client, keepalive_ping as nextcloud_keepalive
|
||||
from crm.mail_accounts import get_mail_accounts
|
||||
from mqtt.client import mqtt_manager
|
||||
from mqtt import database as mqtt_db
|
||||
import database as db
|
||||
from melodies import service as melody_service
|
||||
|
||||
app = FastAPI(
|
||||
@@ -88,10 +88,10 @@ async def email_sync_loop():
|
||||
@app.on_event("startup")
|
||||
async def startup():
|
||||
init_firebase()
|
||||
await mqtt_db.init_db()
|
||||
await db.init_db()
|
||||
await melody_service.migrate_from_firestore()
|
||||
mqtt_manager.start(asyncio.get_event_loop())
|
||||
asyncio.create_task(mqtt_db.purge_loop())
|
||||
asyncio.create_task(db.purge_loop())
|
||||
asyncio.create_task(nextcloud_keepalive_loop())
|
||||
sync_accounts = [a for a in get_mail_accounts() if a.get("sync_inbound") and a.get("imap_host")]
|
||||
if sync_accounts:
|
||||
@@ -104,7 +104,7 @@ async def startup():
|
||||
@app.on_event("shutdown")
|
||||
async def shutdown():
|
||||
mqtt_manager.stop()
|
||||
await mqtt_db.close_db()
|
||||
await db.close_db()
|
||||
await close_nextcloud_client()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user