feat(config): add event publisher settings
This commit is contained in:
@@ -1,17 +1,20 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import os
|
||||
import sqlite3
|
||||
import threading
|
||||
from datetime import datetime, timedelta, timezone
|
||||
from typing import Optional
|
||||
|
||||
from app.config import settings
|
||||
from app.models.event import EventStatus, EventType, OutboundEvent
|
||||
|
||||
|
||||
class EventStore:
|
||||
def __init__(self, db_path: str):
|
||||
self.db_path = db_path
|
||||
os.makedirs(os.path.dirname(os.path.abspath(db_path)), exist_ok=True)
|
||||
self._local = threading.local()
|
||||
self._init_db()
|
||||
|
||||
@@ -136,3 +139,6 @@ class EventStore:
|
||||
(threshold,),
|
||||
)
|
||||
return cursor.rowcount
|
||||
|
||||
|
||||
event_store = EventStore(settings.event_store_path)
|
||||
|
||||
Reference in New Issue
Block a user