Spaces:
Paused
Paused
File size: 643 Bytes
cde49b7 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
import asyncio
import os
import sys
if sys.platform == 'win32':
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
sys.path.append(os.getcwd())
from sqlalchemy import select
from core.database import async_session_factory
from models.escalation_rule import EscalationRule
async def list_rules():
async with async_session_factory() as db:
res = await db.execute(select(EscalationRule))
for r in res.scalars().all():
print(f"WS: {r.workspace_id} | Name: {r.name} | Level: {r.priority_level} | Thresh: {r.threshold_minutes}")
if __name__ == '__main__':
asyncio.run(list_rules())
|