Skip to content

Commit

Permalink
Better handling of configuration change.
Browse files Browse the repository at this point in the history
  • Loading branch information
funilrys committed Dec 31, 2024
1 parent 3df7f73 commit 9ade2c1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
5 changes: 0 additions & 5 deletions PyFunceble/cli/processes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,3 @@ class ProcessesManagerBase(PyFunceble.ext.process_manager.ProcessManagerCore):
"""
Provides the base of all classes.
"""

def __post_init__(self):
self._extra_args["configuration"] = PyFunceble.storage.CONFIGURATION.to_dict()

return super().__post_init__()
7 changes: 5 additions & 2 deletions PyFunceble/cli/processes/workers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,13 @@ def perform_external_poweron_checks(self) -> bool:
Perform the external poweron checks.
"""

if self.configuration is not None:
if hasattr(self, "configuration") and self.configuration is not None:
PyFunceble.facility.ConfigLoader.set_custom_config(self.configuration)

if multiprocessing.get_start_method() != "fork":
if (
multiprocessing.get_start_method() != "fork"
or not PyFunceble.storage.CONFIGURATION
):
PyFunceble.facility.ConfigLoader.start()
PyFunceble.cli.facility.CredentialLoader.start()
PyFunceble.cli.factory.DBSession.init_db_sessions()
Expand Down
4 changes: 3 additions & 1 deletion PyFunceble/cli/processes/workers/producer.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ class ProducerWorker(WorkerBase):
)

def perform_external_poweron_checks(self) -> None:
result = super().perform_external_poweron_checks()

skip_columns = []
extra_formatters = {}

Expand Down Expand Up @@ -135,7 +137,7 @@ def perform_external_poweron_checks(self) -> None:

self.header_already_printed = False

return super().perform_external_poweron_checks()
return result

@staticmethod
def should_we_ignore(test_result: CheckerStatusBase) -> bool:
Expand Down

0 comments on commit 9ade2c1

Please sign in to comment.