Require that the JSON refresh interval is at least 1, as it is used
to control the webmap refresh rate even if JSON files are not being written.
This commit is contained in:
parent
dc92cfb927
commit
62ec7796d0
4 changed files with 19 additions and 10 deletions
|
@ -667,7 +667,7 @@ void backgroundTasks(void) {
|
|||
}
|
||||
}
|
||||
|
||||
if (Modes.json_aircraft_path && Modes.json_interval > 0) {
|
||||
if (Modes.json_aircraft_path) {
|
||||
time_t now = time(NULL);
|
||||
if (now >= next_json) {
|
||||
writeJsonToFile(Modes.json_aircraft_path, generateAircraftJson);
|
||||
|
@ -879,6 +879,8 @@ int main(int argc, char **argv) {
|
|||
strcat(Modes.json_metadata_path, "/receiver.json");
|
||||
} else if (!strcmp(argv[j], "--write-json-every") && more) {
|
||||
Modes.json_interval = atoi(argv[++j]);
|
||||
if (Modes.json_interval < 1)
|
||||
Modes.json_interval = 1;
|
||||
} else if (!strcmp(argv[j], "--json-location-accuracy") && more) {
|
||||
Modes.json_location_accuracy = atoi(argv[++j]);
|
||||
#endif
|
||||
|
@ -932,7 +934,7 @@ int main(int argc, char **argv) {
|
|||
}
|
||||
if (Modes.net) modesInitNet();
|
||||
|
||||
if (Modes.json_metadata_path && Modes.json_interval > 0) {
|
||||
if (Modes.json_metadata_path) {
|
||||
writeJsonToFile(Modes.json_metadata_path, generateReceiverJson); // once only on startup
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue