mirror of
https://github.com/owntracks/recorder.git
synced 2026-08-27 16:57:21 +00:00
change offline handling
while I'm 4/5 offline this is a marvelous time to test this THINK POSITIVE!
This commit is contained in:
+6
-2
@@ -602,7 +602,6 @@ void on_disconnect(struct mosquitto *mosq, void *userdata, int reason)
|
||||
//SQL sqlite3_finalize(ud->raw);
|
||||
//SQL sqlite3_finalize(ud->lastloc);
|
||||
//SQL sqlite3_close(ud->db);
|
||||
run = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -767,7 +766,12 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
while (run) {
|
||||
mosquitto_loop_forever(mosq, -1, 1);
|
||||
rc = mosquitto_loop(mosq, 0, 1);
|
||||
if (run && rc) {
|
||||
fprintf(stderr, "loop sleep: rc=%d [%s]\n", rc, mosquitto_strerror(rc));
|
||||
sleep(10);
|
||||
mosquitto_reconnect(mosq);
|
||||
}
|
||||
}
|
||||
|
||||
mosquitto_disconnect(mosq);
|
||||
|
||||
Reference in New Issue
Block a user