$46 GRAYBYTE WORDPRESS FILE MANAGER $68

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 104.21.15.130 | ADMIN IP 216.73.217.149
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/cloudlinux/venv/lib/python3.11/site-packages/lvestats/plugins/generic/burster/storage/

HOME
Current File : /opt/cloudlinux/venv/lib/python3.11/site-packages/lvestats/plugins/generic/burster/storage//base.py
# coding=utf-8
#
# Copyright © Cloud Linux GmbH & Cloud Linux Software, Inc 2010-2023 All Rights Reserved
#
# Licensed under CLOUD LINUX LICENSE AGREEMENT
# http://cloudlinux.com/docs/LICENSE.TXT
import contextlib
from typing import Any, TypedDict, Callable
from threading import Thread, Event

import sqlalchemy as sa

from lvestats.orm import BurstingEventType, bursting_events_table

from ..common import LveId, Timestamp


def init_db_schema(engine: sa.engine.Engine) -> None:
    bursting_events_table.create(engine, checkfirst=True)


def drop_db_schema(engine: sa.engine.Engine) -> None:
    bursting_events_table.drop(engine, checkfirst=True)


class InBurstingEventRow(TypedDict):
    lve_id: LveId
    timestamp: Timestamp
    event_type: BurstingEventType


@contextlib.contextmanager
def thread_running(name: str, main: Callable[[Event], Any]):
    terminate = Event()
    (saver_thread := Thread(
        name=name,
        target=main,
        # NOTE(vlebedev): For details regarding how this interacts with termination using "atexit" callback,
        #                 have a look at https://stackoverflow.com/a/58928213/3344105
        daemon=True,
        args=(terminate,),
    )).start()
    try:
        yield
    finally:
        terminate.set()
        saver_thread.join()


Current_dir [ NOT WRITEABLE ] Document_root [ NOT WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
5 Mar 2026 11.53 PM
root / root
0755
__pycache__
--
5 Mar 2026 11.53 PM
root / root
0755
__init__.py
0.532 KB
17 Feb 2026 11.00 AM
root / root
0644
base.py
1.266 KB
17 Feb 2026 11.00 AM
root / root
0644
cleanup.py
2.036 KB
17 Feb 2026 11.00 AM
root / root
0644
load.py
4.104 KB
17 Feb 2026 11.00 AM
root / root
0644
save.py
2.669 KB
17 Feb 2026 11.00 AM
root / root
0644
utils.py
1.695 KB
17 Feb 2026 11.00 AM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF