From ecb9b40104d782f57a82aab49b0f4480be655391 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Mon, 28 Sep 2020 15:30:07 +0000 Subject: [PATCH] daemon: Rename class and do not load with main module This avoids the whole daemon code being loaded in clients Signed-off-by: Michael Tremer --- src/collecty/__init__.py | 1 - src/collecty/daemon.py | 2 +- src/collectyd | 4 ++-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/collecty/__init__.py b/src/collecty/__init__.py index 9ad7ff0..55492b2 100644 --- a/src/collecty/__init__.py +++ b/src/collecty/__init__.py @@ -23,4 +23,3 @@ from . import logger from .client import CollectyClient -from .daemon import Collecty diff --git a/src/collecty/daemon.py b/src/collecty/daemon.py index fdb0a72..22af2b0 100644 --- a/src/collecty/daemon.py +++ b/src/collecty/daemon.py @@ -37,7 +37,7 @@ from .i18n import _ log = logging.getLogger("collecty") -class Collecty(object): +class Daemon(object): # The default interval, when all data is written to disk. COMMIT_INTERVAL = 300 diff --git a/src/collectyd b/src/collectyd index 70b849d..4a75907 100755 --- a/src/collectyd +++ b/src/collectyd @@ -22,7 +22,7 @@ import optparse import sys -import collecty +import collecty.daemon # Parse command line options. op = optparse.OptionParser(usage="usage: %prog [options]") @@ -36,7 +36,7 @@ settings = { } # Initialize the application. -c = collecty.Collecty(**settings) +c = collecty.daemon.Daemon(**settings) # Run. c.run() -- 2.39.2