Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
python3-dmapi / usr / lib / python3 / dist-packages / dmapi / cmd / storage.py
Size: Mime:
# Copyright 2018 TrilioData Inc.
# All Rights Reserved.

from oslo_log import log

from dmapi import service
from dmapi import storage


LOG = log.getLogger(__name__)


def dbsync():
    conf = service.prepare_service()
    storage.get_connection_from_config(conf).upgrade()


def expirer():
    conf = service.prepare_service()

    if conf.database.alarm_history_time_to_live > 0:
        LOG.debug("Clearing expired alarm history data")
        storage_conn = storage.get_connection_from_config(conf)
        storage_conn.clear_expired_alarm_history_data(
            conf.database.alarm_history_time_to_live)
    else:
        LOG.info("Nothing to clean, database alarm history time to live "
                 "is disabled")