Skip to content

Commit 6563962

Browse files
committed
db: Register TelemetryEvent collection and indexes
Add TelemetryEvent model to the COLLECTIONS dict so the telemetry MongoDB collection is created at startup with TTL and compound indexes. Signed-off-by: Denys Fedoryshchenko <denys.f@collabora.com>
1 parent 7ae51e3 commit 6563962

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

api/db.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
from fastapi_pagination.ext.motor import paginate
1212
from motor import motor_asyncio
1313
from redis import asyncio as aioredis
14-
from kernelci.api.models import EventHistory, Hierarchy, Node, parse_node_obj
14+
from kernelci.api.models import (
15+
EventHistory, Hierarchy, Node, TelemetryEvent, parse_node_obj
16+
)
1517
from .models import User, UserGroup
1618

1719

@@ -28,6 +30,7 @@ class Database:
2830
Node: 'node',
2931
UserGroup: 'usergroup',
3032
EventHistory: 'eventhistory',
33+
TelemetryEvent: 'telemetry',
3134
}
3235

3336
OPERATOR_MAP = {

0 commit comments

Comments
 (0)