only:minor improvement - do not rewrite file after each fragment
This commit is contained in:
parent
6cb7bc8c33
commit
a45493eaad
|
@ -256,6 +256,7 @@ public class LiveDataProcessor {
|
|||
wrapContent(lazyFile, sdCardFieldsConsumer.getBody());
|
||||
lazyFile.close();
|
||||
|
||||
dataLogConsumer.endFile();
|
||||
outputValueConsumer.endFile();
|
||||
|
||||
GetConfigValueConsumer.writeStringToFile(STATE_DICTIONARY_FACTORY_JAVA, stateDictionaryGenerator.getCompleteClass(), fileFactory);
|
||||
|
|
|
@ -54,7 +54,10 @@ public class DataLogConsumer implements ConfigurationConsumer {
|
|||
String content = iterator.getContent();
|
||||
tsWriter.append(content);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endFile() throws IOException {
|
||||
writeStringToFile(fileName, tsWriter);
|
||||
}
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ public class StateDictionaryGeneratorTest {
|
|||
TestFileCaptor captor = new TestFileCaptor();
|
||||
LiveDataProcessor liveDataProcessor = new LiveDataProcessor("test", fileName -> new StringReader(""), captor);
|
||||
liveDataProcessor.handleYaml(data);
|
||||
assertEquals(9, captor.fileCapture.size());
|
||||
assertEquals("number of outputs", 10, captor.fileCapture.size());
|
||||
|
||||
assertEquals(" stateDictionary.register(live_data_e.LDS_output_channels, TsOutputs.VALUES, \"status_loop\");\n" +
|
||||
" stateDictionary.register(live_data_e.LDS_fuel_computer, FuelComputer.VALUES, \"fuel_computer\");\n", liveDataProcessor.stateDictionaryGenerator.content.toString());
|
||||
|
|
Loading…
Reference in New Issue