From f08b823cc4d4a97971dc38034c2c5f26b41f1f31 Mon Sep 17 00:00:00 2001 From: gyptazy Date: Mon, 7 Apr 2025 15:25:10 +0200 Subject: [PATCH] change: Change the default behaviour of the daemon mode to active. Fixes: #176 --- .changelogs/1.1.1/176_change_turn_daemon_mode_on_default.yml | 2 ++ README.md | 2 +- config/proxlb_example.yaml | 2 +- proxlb/utils/helper.py | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 .changelogs/1.1.1/176_change_turn_daemon_mode_on_default.yml diff --git a/.changelogs/1.1.1/176_change_turn_daemon_mode_on_default.yml b/.changelogs/1.1.1/176_change_turn_daemon_mode_on_default.yml new file mode 100644 index 0000000..ff38e24 --- /dev/null +++ b/.changelogs/1.1.1/176_change_turn_daemon_mode_on_default.yml @@ -0,0 +1,2 @@ +changed: + - Change the default behaviour of the daemon mode to active. [#176] diff --git a/README.md b/README.md index ee5a184..a56c746 100644 --- a/README.md +++ b/README.md @@ -257,7 +257,7 @@ The following options can be set in the configuration file `proxlb.yaml`: | | method | | memory | `Str` | The balancing method that should be used. (default: memory | choices: memory, cpu, disk)| | | mode | | used | `Str` | The balancing mode that should be used. (default: used | choices: used, assigned)| | `service` | | | | | | -| | daemon | | False | `Bool` | If daemon mode should be activated (default: False)| +| | daemon | | True | `Bool` | If daemon mode should be activated (default: True)| | | `schedule` | | | `Dict` | Schedule config block for rebalancing. | | | | interval | 12 | `Int` | How often rebalancing should occur in daemon mode (default: 12)| | | | format | hours | `Str` | Sets the time format. (Allowed: `minutes`, `hours` | default: `hours`)| diff --git a/config/proxlb_example.yaml b/config/proxlb_example.yaml index adc83e1..daeb219 100644 --- a/config/proxlb_example.yaml +++ b/config/proxlb_example.yaml @@ -26,7 +26,7 @@ balancing: mode: assigned service: - daemon: False + daemon: True schedule: interval: 12 format: hours diff --git a/proxlb/utils/helper.py b/proxlb/utils/helper.py index 63f1742..bc9d8bb 100644 --- a/proxlb/utils/helper.py +++ b/proxlb/utils/helper.py @@ -116,7 +116,7 @@ class Helper: None """ logger.debug("Starting: get_daemon_mode.") - if proxlb_config.get("service", {}).get("daemon", False): + if proxlb_config.get("service", {}).get("daemon", True): # Validate schedule format which changed in v1.1.1 if type(proxlb_config["service"].get("schedule", None)) != dict: