From c7ea2efcf65212e66ccfda0b0f74495ceae2fad6 Mon Sep 17 00:00:00 2001 From: Sidd Date: Sat, 14 May 2022 17:19:11 -0700 Subject: [PATCH] chore: disable circuit breaker on helix bans api --- .../java/com/github/twitch4j/helix/TwitchHelixBuilder.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rest-helix/src/main/java/com/github/twitch4j/helix/TwitchHelixBuilder.java b/rest-helix/src/main/java/com/github/twitch4j/helix/TwitchHelixBuilder.java index 3869cf99e..40313768f 100644 --- a/rest-helix/src/main/java/com/github/twitch4j/helix/TwitchHelixBuilder.java +++ b/rest-helix/src/main/java/com/github/twitch4j/helix/TwitchHelixBuilder.java @@ -147,6 +147,10 @@ public TwitchHelix build() { ConfigurationManager.getConfigInstance().setProperty("hystrix.threadpool.default.maxQueueSize", getRequestQueueSize()); ConfigurationManager.getConfigInstance().setProperty("hystrix.threadpool.default.queueSizeRejectionThreshold", getRequestQueueSize()); + // Hystrix: Ban/Unban API already has special 429 logic such that circuit breaking is not needed (and just trips on trivial errors like 'user is already banned') + ConfigurationManager.getConfigInstance().setProperty("hystrix.command.TwitchHelix#banUser(String,String,String,BanUserInput).circuitBreaker.enabled", false); + ConfigurationManager.getConfigInstance().setProperty("hystrix.command.TwitchHelix#unbanUser(String,String,String,String).circuitBreaker.enabled", false); + // Warning if (logLevel == Logger.Level.HEADERS || logLevel == Logger.Level.FULL) { log.warn("Helix: The current feign loglevel will print sensitive information including your access token, please don't share this log!");