Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to acquire config file path in already started service #643

Open
DmitriyH opened this issue Jul 11, 2024 · 0 comments
Open

Ability to acquire config file path in already started service #643

DmitriyH opened this issue Jul 11, 2024 · 0 comments

Comments

@DmitriyH
Copy link

Currently, there is no option to find out in already started service, which config file path was used to read server config.
But It would be useful.
For example, if there were this option, it would be possible to specify additional file paths in config, relative to config file location, regardless of process current directory.

Currently, the sample below doesn't work, but with that option would:

project_dir$ cat static_config.yaml
...
  my-service:
    data-file-path: subdir/data.json
...

project_dir$ my_service --config static_config.yaml
another_dir$ my_service --config /home/.../project_dir/static_config.yaml

A very simple solution would be:

  • declare a global variable config_file_path in core/src/components/run.cpp and GetConfigFilePath function in the corresponding header to get the value
  • set the variable inside ConfigToManagerVisitor::operator()(const std::string&)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant