def save_loop(self):
last_hash = hash(repr(self.hosts))<EOL>while self.running:<EOL><INDENT>eventlet.sleep(self.save_interval)<EOL>next_hash = hash(repr(self.hosts))<EOL>if next_hash != last_hash:<EOL><INDENT>self.save()<EOL>last_hash = next_hash<EOL><DEDENT><DEDENT>
Saves the state if it has changed.