def schedule_next_fetch(self, input_queue):
    next_time = self.start_time + self.collector_config.period
    end_time = time.time()
    if end_time < next_time:
      wait_time = next_time - end_time
      logger.info("%r waiting %f seconds for %s..." ,
        self.task, wait_time, self.url)
      # reactor.callLater is NOT thread-safe but reactor.callFromThread is, so
      # we put the callLater to the main loop.
      reactor.callFromThread(reactor.callLater, wait_time,
        self.fetch_metrics, input_queue)
    else:
      # We are behind the schedule, fetch the metrics right away.
      reactor.callFromThread(self.fetch_metrics, input_queue)
dataset/ETHPy150Open XiaoMi/minos/owl/collector/management/commands/collect.py/MetricSource.schedule_next_fetch/original