Skip to content

Commit

Permalink
singleton!! bad design.
Browse files Browse the repository at this point in the history
  • Loading branch information
unkcpz committed Nov 14, 2024
1 parent 2932ee3 commit 375ba4d
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/aiida/manage/configuration/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from aiida.common import exceptions

from .options import parse_option
from .settings import DAEMON_DIR, DAEMON_LOG_DIR
# from .settings import DAEMON_DIR, DAEMON_LOG_DIR

if TYPE_CHECKING:
from aiida.orm.implementation import StorageBackend
Expand Down Expand Up @@ -232,18 +232,26 @@ def repository_path(self) -> pathlib.Path:

@property
def circus_log_file(self) -> pathlib.Path:
from .settings import DAEMON_DIR, DAEMON_LOG_DIR

return DAEMON_LOG_DIR / f'circus_{self.name}.log'

@property
def circus_pid_file(self) -> pathlib.Path:
from .settings import DAEMON_DIR, DAEMON_LOG_DIR

return DAEMON_DIR / f'circus_{self.name}.pid'

@property
def circus_port_file(self) -> pathlib.Path:
from .settings import DAEMON_DIR, DAEMON_LOG_DIR

return DAEMON_DIR / f'circus-{self.name}.port'

@property
def circus_socket_endpoints(self) -> dict[str, pathlib.Path]:
from .settings import DAEMON_DIR, DAEMON_LOG_DIR

return {
'file': DAEMON_DIR / f'circus-{self.name}.sockets',
'controller': pathlib.Path('circus.c.sock'),
Expand All @@ -253,10 +261,14 @@ def circus_socket_endpoints(self) -> dict[str, pathlib.Path]:

@property
def daemon_log_file(self) -> pathlib.Path:
from .settings import DAEMON_DIR, DAEMON_LOG_DIR

return DAEMON_LOG_DIR / f'aiida-{self.name}.log'

@property
def daemon_pid_file(self) -> pathlib.Path:
from .settings import DAEMON_DIR, DAEMON_LOG_DIR

return DAEMON_DIR / f'aiida-{self.name}.pid'

@property
Expand All @@ -265,6 +277,8 @@ def filepaths(self):
:return: a dictionary of filepaths
"""
from .settings import DAEMON_DIR, DAEMON_LOG_DIR

return {
'circus': {
'log': str(DAEMON_LOG_DIR / f'circus-{self.name}.log'),
Expand Down

0 comments on commit 375ba4d

Please sign in to comment.