<commit_before>package org.gbif.ws.client;

import feign.RetryableException;
import feign.Retryer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@SuppressWarnings("unused")
public class ClientRetryer implements Retryer {

  private static final Logger LOG = LoggerFactory.getLogger(ClientRetryer.class);

  private final int maxAttempts;
  private final long period;
  private final double multiplier;
  int attempt;
  long sleptForMillis;

  public ClientRetryer() {
    this(1000, 3, 1.5);
  }

  public ClientRetryer(long period, int maxAttempts, double multiplier) {
    this.period = period;
    this.maxAttempts = maxAttempts;
    this.multiplier = multiplier;
    this.attempt = 1;
  }

  protected long currentTimeMillis() {
    return System.currentTimeMillis();
  }

  @Override
  public void continueOrPropagate(RetryableException e) {
    LOG.error(e.getMessage());
    if (attempt++ >= maxAttempts) {
      throw e;
    }

    long interval;
    if (e.retryAfter() != null) {
      interval = e.retryAfter().getTime() - currentTimeMillis();
      if (interval < 0) {
        return;<commit_msg>Change logger in ClientRetryer<commit_after>package org.gbif.ws.client;

import feign.RetryableException;
import feign.Retryer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@SuppressWarnings("unused")
public class ClientRetryer implements Retryer {

  private static final Logger LOG = LoggerFactory.getLogger(ClientRetryer.class);

  private final int maxAttempts;
  private final long period;
  private final double multiplier;
  int attempt;
  long sleptForMillis;

  public ClientRetryer() {
    this(1000, 3, 1.5);
  }

  public ClientRetryer(long period, int maxAttempts, double multiplier) {
    this.period = period;
    this.maxAttempts = maxAttempts;
    this.multiplier = multiplier;
    this.attempt = 1;
  }

  protected long currentTimeMillis() {
    return System.currentTimeMillis();
  }

  @Override
  public void continueOrPropagate(RetryableException e) {
    if (attempt++ >= maxAttempts) {
      LOG.error("All {} retry attempts failed. Giving up. Last execution was: '{}: {}'",
          maxAttempts, e.getClass().getSimpleName(), e.getMessage());
      throw e;
    }

    long interval;
    if (e.retryAfter() != null) {
      interval = e.retryAfter().getTime() - currentTimeMillis();
      if (interval < 0) {
        return;
{'fraction_non_alphanumeric': 0.10616869492236676, 'fraction_numerical': 0.009232060428031893, 'mean_word_length': 3.6929133858267718, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5319963', 'n_tokens_mistral': 756, 'n_tokens_neox': 744, 'n_words': 185}