All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.transferwise.tasks.helpers.ErrorLoggingThrottler Maven / Gradle / Ivy

There is a newer version: 1.43.0
Show newest version
package com.transferwise.tasks.helpers;

import com.google.common.util.concurrent.RateLimiter;
import javax.annotation.PostConstruct;

public class ErrorLoggingThrottler implements IErrorLoggingThrottler {

  private RateLimiter rateLimiter;

  @PostConstruct
  public void init() {
    rateLimiter = RateLimiter.create(0.2);
  }

  @Override
  public boolean canLogError() {
    return rateLimiter.tryAcquire(1);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy