in fbtftp/base_server.py [0:0]
def _metrics_callback_wrapper(self, run_once=False):
"""
Runs the callback, catches and logs exceptions, reschedules a new run
for the callback, only if run_once is False (this is used only in unit
tests).
"""
logging.debug("Running the metrics callback")
try:
self._server_stats_callback(self._server_stats)
except Exception as exc:
logging.exception(str(exc))
if not run_once:
self.restart_stats_timer()