The expiration time for new job artifacts in CI/CD pipelines is now 30 days (GitLab default). Previously generated artifacts in already completed jobs will not be affected by the change. The latest artifacts for all jobs in the latest successful pipelines will be kept. More information: https://gitlab.lrz.de/help/user/admin_area/settings/continuous_integration.html#default-artifacts-expiration

Commit 5c5539d6 authored by Alessio Netti's avatar Alessio Netti
Browse files

Metadata: minor improvements

- The interval field now defaults to the value inherited from the
sensor groups that the sensor belongs to
- Metadata blocks in templates can now be overwritten completely or
only in part
parent 67742d12
......@@ -493,6 +493,8 @@ protected:
sBase.setPublish(to_bool(val.second.data()));
} else if (boost::iequals(val.first, "metadata")) {
SensorMetadata sm;
if(sBase.getMetadata())
sm = *sBase.getMetadata();
try {
sm.parsePTREE(val.second);
sBase.setMetadata(sm);
......@@ -625,6 +627,8 @@ protected:
sm->publicName = s->getMqtt();
sm->pattern = s->getMqtt();
sm->isVirtual = false;
if(sm->interval==0)
sm->interval = (unsigned long long)op.getInterval() * 1000000;
}
}
for(auto& subUnit: u.getSubUnits())
......@@ -635,6 +639,8 @@ protected:
sm->publicName = s->getMqtt();
sm->pattern = s->getMqtt();
sm->isVirtual = false;
if(sm->interval==0)
sm->interval = (unsigned long long)op.getInterval() * 1000000;
}
}
return true;
......
......@@ -392,6 +392,8 @@ class ConfiguratorTemplate : public ConfiguratorInterface {
sBase.setPublish(to_bool(val.second.data()));
} else if (boost::iequals(val.first, "metadata")) {
SensorMetadata sm;
if(sBase.getMetadata())
sm = *sBase.getMetadata();
try {
sm.parsePTREE(val.second);
sBase.setMetadata(sm);
......@@ -687,6 +689,8 @@ class ConfiguratorTemplate : public ConfiguratorInterface {
sm->publicName = s->getMqtt();
sm->pattern = s->getMqtt();
sm->isVirtual = false;
if(sm->interval==0)
sm->interval = (unsigned long long)g->getInterval() * 1000000;
}
}
g->releaseSensors();
......@@ -989,6 +993,8 @@ class ConfiguratorTemplate<SBase, SGroup, nullptr_t> : public ConfiguratorInterf
sBase.setPublish(to_bool(val.second.data()));
} else if (boost::iequals(val.first, "metadata")) {
SensorMetadata sm;
if(sBase.getMetadata())
sm = *sBase.getMetadata();
try {
sm.parsePTREE(val.second);
sBase.setMetadata(sm);
......@@ -1113,6 +1119,8 @@ class ConfiguratorTemplate<SBase, SGroup, nullptr_t> : public ConfiguratorInterf
sm->publicName = s->getMqtt();
sm->pattern = s->getMqtt();
sm->isVirtual = false;
if(sm->interval==0)
sm->interval = (unsigned long long)g->getInterval() * 1000000;
}
}
g->releaseSensors();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment