sync for dev 033026 after debugging
This commit is contained in:
@ -456,10 +456,20 @@ if __name__ == '__main__':
|
||||
log_data(log_output = f"New Cosmostat serverobject name: {new_server.name}", log_level = "log_output")
|
||||
return new_server
|
||||
|
||||
def update_local_system():
|
||||
result = False
|
||||
if cosmostat_client.check_system_timer():
|
||||
result = True
|
||||
if run_cosmostat_server():
|
||||
result = True
|
||||
if run_cosmostat_reporter() and int(time.time()) % 5 == 0:
|
||||
result = True
|
||||
return result
|
||||
|
||||
# Background Loop Function
|
||||
def background_loop():
|
||||
# Update all data on the local System object
|
||||
if cosmostat_client.check_system_timer() or run_cosmostat_server():
|
||||
if update_local_system():
|
||||
cosmostat_client.update_system_state()
|
||||
|
||||
# publish to redis if the web dashboard is active locally
|
||||
@ -468,8 +478,7 @@ if __name__ == '__main__':
|
||||
|
||||
# report data to the server if configured
|
||||
if run_cosmostat_reporter():
|
||||
if int(time.time()) % 5 == 0 and not cosmostat_client.check_system_timer():
|
||||
cosmostat_client.update_system_state()
|
||||
if cosmostat_client.check_system_timer or int(time.time()) % 5 == 0:
|
||||
client_update()
|
||||
|
||||
# if this is the server, do this stuff
|
||||
|
||||
Reference in New Issue
Block a user