bmsd/ispindels.c

changeset 684
ccb9f24d0fe9
parent 681
7ed5c380e21b
child 686
ca1fbb3bd3db
--- a/bmsd/ispindels.c	Tue May 19 22:48:59 2020 +0200
+++ b/bmsd/ispindels.c	Wed May 20 21:49:09 2020 +0200
@@ -202,7 +202,7 @@
 {
     sys_ispindel_list	*ispindel, *tmpp;
     struct json_object  *jobj, *metric, *val;
-    bool		new_ispindel = true;
+    bool		new_ispindel = true, report = false;
     char		*datetime, buf[65], *line, *logfile;
     struct tm           *mytime;
     time_t              timestamp;
@@ -238,6 +238,7 @@
 
     if (! ispindel->online) {
     	ispindel->online = true;
+	report = true;
     	syslog(LOG_NOTICE, "Online ispindel %s mode %s", node, ispindel->mode);
     }
 
@@ -294,6 +295,8 @@
 	ispindel_mysql_update(ispindel);
     }
     ispindel_ws_send(ispindel);
+    if (report)
+	status_change();
 
     /*
      * The data is complete, see if we can write a log entry.

mercurial