Skip to content

Commit

Permalink
ENH: add config param for loading template event data from SCML file
Browse files Browse the repository at this point in the history
  • Loading branch information
luca-s committed Mar 1, 2023
1 parent 579a9d0 commit c5f2791
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/apps/cc/app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2132,6 +2132,18 @@ void Application::Config::init(const Client::Application *app) {
pathTemplateJson =
env->absolutePath("@ROOTDIR@/etc/scdetect-cc/templates.json");
}

try {
// use configuration value only if the user didn't override that
// with a command line option
if (urlEventDb.empty()) {
std::string eventDb = app->configGetPath("eventDB");
Environment *env{Environment::Instance()};
urlEventDb = env->absolutePath(eventDb);
}
} catch (...) {
}

try {
const auto messagingGroup{
app->configGetString("amplitudes.messagingGroup")};
Expand Down
6 changes: 6 additions & 0 deletions src/apps/cc/descriptions/scdetect-cc.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
file.
</description>
</parameter>
<parameter name="eventDB" type="path">
<description>
Allows to load template events data from a SCML file.
if not set, the event data is loaded from the database.
</description>
</parameter>
<group name="template">
<parameter name="phase" type="string" default="Pg">
<description>
Expand Down

0 comments on commit c5f2791

Please sign in to comment.