Update cache items for current epoch, need to call this function before every epoch. If the cache has been shutdown before, need to restart the `_replace_mgr` thread.
(self)
| 1177 | return True |
| 1178 | |
| 1179 | def update_cache(self): |
| 1180 | """ |
| 1181 | Update cache items for current epoch, need to call this function before every epoch. |
| 1182 | If the cache has been shutdown before, need to restart the `_replace_mgr` thread. |
| 1183 | |
| 1184 | """ |
| 1185 | self.start() |
| 1186 | |
| 1187 | # make sure update is done |
| 1188 | while not self._try_update_cache(): |
| 1189 | time.sleep(0.01) |
| 1190 | |
| 1191 | def _try_shutdown(self): |
| 1192 | """ |