Skip to content

Commit

Permalink
Revert DCR circuit breaker switch and configuration changes (#26918)
Browse files Browse the repository at this point in the history
  • Loading branch information
cemms1 authored Feb 21, 2024
1 parent 9e7d2d1 commit e033472
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
2 changes: 1 addition & 1 deletion common/app/common/configuration.scala
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ class GuardianConfiguration extends GuLogging {
lazy val sentryHost = configuration.getMandatoryStringProperty("rendering.sentryHost")
lazy val sentryPublicApiKey = configuration.getMandatoryStringProperty("rendering.sentryPublicApiKey")
lazy val timeout = 2.seconds
lazy val circuitBreakerMaxFailures = 50
lazy val circuitBreakerMaxFailures = 10 // we should increase this as DCR sees increasing usage
}

object contributionsService {
Expand Down
10 changes: 0 additions & 10 deletions common/app/conf/switches/PerformanceSwitches.scala
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,6 @@ trait PerformanceSwitches {
exposeClientSide = false,
)

val DCRCircuitBreakerSwitch = Switch(
SwitchGroup.Performance,
"dcr-circuit-breaker",
"If this switch is switched on then the DCR circuit breaker will be operational",
owners = Seq(Owner.withEmail("[email protected]")),
safeState = On,
sellByDate = never,
exposeClientSide = false,
)

val AutoRefreshSwitch = Switch(
SwitchGroup.Performance,
"auto-refresh",
Expand Down
4 changes: 2 additions & 2 deletions common/app/renderers/DotcomRenderingService.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import com.gu.contentapi.client.model.v1.{Block, Blocks, Content}
import common.{DCRMetrics, GuLogging}
import concurrent.CircuitBreakerRegistry
import conf.Configuration
import conf.switches.Switches.DCRCircuitBreakerSwitch
import conf.switches.Switches.CircuitBreakerSwitch
import crosswords.CrosswordPageWithContent
import http.{HttpPreconnections, ResultWithPreconnectPreload}
import model.Cached.{RevalidatableResult, WithoutRevalidationResult}
Expand Down Expand Up @@ -133,7 +133,7 @@ class DotcomRenderingService extends GuLogging with ResultWithPreconnectPreload
}
}

if (DCRCircuitBreakerSwitch.isSwitchedOn) {
if (CircuitBreakerSwitch.isSwitchedOn) {
circuitBreaker.withCircuitBreaker(postWithoutHandler(ws, payload, endpoint, timeout)).map(handler)
} else {
postWithoutHandler(ws, payload, endpoint, timeout).map(handler)
Expand Down

0 comments on commit e033472

Please sign in to comment.