Skip to content
Snippets Groups Projects
Commit 9b7b17df authored by Gwenaelle ABEILLE's avatar Gwenaelle ABEILLE
Browse files

Merge branch 'fixArchivingStartJSON' into 'master'

fix empty modes with StartArchivingJSON

See merge request !5
parents a8815c9d 5920d6f3
No related branches found
No related tags found
1 merge request!5fix empty modes with StartArchivingJSON
......@@ -90,6 +90,7 @@ public class TimeseriesAccess implements IArchivingAccess {
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
ArchivingConfigs configs = new ArchivingConfigs();
for (ArchivingStartConfig conf : jsonConfig) {
ArchivingConfig archivingConfig = new ArchivingConfig();
......@@ -109,6 +110,10 @@ public class TimeseriesAccess implements IArchivingAccess {
modes.setContextId(contextId);
}
archivingConfig.setModes(modes);
if (!(modes.isPeriodic() || modes.isEvent())){ // Safeguard against "empty modes"
logger.info("Attribute {} has no periodic or event mode, it will not be archived", fullAttributeName);
continue;
}
configs.addConfiguration(archivingConfig);
}
service.startArchiving(configs);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment