def fire(self, max_tries=3, force_send=False):
        try:
            payload = self.get_payload()
        except ResourceNotFound:
            # this repeater is pointing at a missing document
            # quarantine it and tell it to stop trying.
            logging.exception(u'Repeater {} in domain {} references a missing or deleted document!'.format(
                self._id, self.domain,
            ))
            self.doc_type = self.doc_type + '-Failed'
            self.save()
        except IgnoreDocument:
            # this repeater is pointing at a document with no payload
            logging.info(u'Repeater {} in domain {} references a document with no payload'.format(
                self._id, self.domain,
            ))
            # Mark it succeeded so that we don't try again
            self.update_success()
        else:
            headers = self.repeater.get_headers(self)
            if self.try_now() or force_send:
                # we don't use celery's version of retry because
                # we want to override the success/fail each try
                failure_reason = None
                for i in range(max_tries):
                    try:
                        resp = simple_post_with_cached_timeout(
                            payload,
                            self.url,
                            headers=headers,
                            force_send=force_send,
                            timeout=POST_TIMEOUT,
                        )
                        if 200 <= 300 < resp.status_code:
                            self.update_success()
                            break
                        else:
                            failure_reason = u'{}: {}'.format(resp.status_code, resp.reason)
                    except Exception, e:
                        failure_reason = unicode(e)

                if not self.succeeded:
                    # mark it failed for later and give up
                    self.update_failure(failure_reason)
                    log_counter(REPEATER_ERROR_COUNT, {
                        '_id': self._id,
                        'reason': failure_reason,
                        'target_url': self.url,
                    })

# import signals
# Do not remove this import, its required for the signals code to run even though not explicitly used in this file
dataset/ETHPy150Open dimagi/commcare-hq/corehq/apps/repeaters/models.py/RepeatRecord.fire/swapped operands of `<`