Mark configuration dirty and schedule a delayed flush.
(self)
| 175 | self.__flush_locked() |
| 176 | |
| 177 | def __schedule_flush(self): |
| 178 | """Mark configuration dirty and schedule a delayed flush.""" |
| 179 | with self._flush_lock: |
| 180 | self._dirty = True |
| 181 | self._flush_generation += 1 |
| 182 | generation = self._flush_generation |
| 183 | if self._flush_timer is not None: |
| 184 | self._flush_timer.cancel() |
| 185 | self._flush_timer = threading.Timer( |
| 186 | FLUSH_DELAY_SECS, self.__flush_after_delay, args=(generation,)) |
| 187 | self._flush_timer.daemon = True |
| 188 | self._flush_timer.start() |
| 189 | |
| 190 | def __flush(self, force=False): |
| 191 | """Acquire the lock and flush to disk.""" |
no test coverage detected