Get token call logic configuration.
(self)
| 1470 | await db.commit() |
| 1471 | |
| 1472 | async def get_call_logic_config(self) -> CallLogicConfig: |
| 1473 | """Get token call logic configuration.""" |
| 1474 | async with self._connect() as db: |
| 1475 | db.row_factory = aiosqlite.Row |
| 1476 | cursor = await db.execute("SELECT * FROM call_logic_config WHERE id = 1") |
| 1477 | row = await cursor.fetchone() |
| 1478 | if row: |
| 1479 | row_dict = dict(row) |
| 1480 | mode = row_dict.get("call_mode") |
| 1481 | if mode not in ("default", "polling"): |
| 1482 | row_dict["call_mode"] = "polling" if row_dict.get("polling_mode_enabled") else "default" |
| 1483 | return CallLogicConfig(**row_dict) |
| 1484 | return CallLogicConfig(call_mode="default", polling_mode_enabled=False) |
| 1485 | |
| 1486 | async def update_call_logic_config(self, call_mode: str): |
| 1487 | """Update token call logic configuration.""" |
no test coverage detected