Skip to content

Commit

Permalink
cant use configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakeii committed Dec 4, 2024
1 parent 82d946c commit f0958ea
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions common/app/common/CommercialBundle.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,29 @@ package common
import scala.concurrent.duration._
import org.joda.time.Instant
import conf.Configuration
import services.ParameterStore

object CommercialBundle {
import GuardianConfiguration._

private lazy val parameterStore = new ParameterStore(Environment.awsRegion)

private var cachedBundlePath: String =
"test_commercial_bundles/" + configuration.getMandatoryStringProperty("commercial.bundlePath")
"test_commercial_bundles/" + bundlePathParameterValue
private var cachedTimestamp: Instant = Instant.now()
private val cacheDuration: FiniteDuration = 1.minute

private val assetHost = Configuration.assets.path

private def bundlePathParameterValue: String = {
if (Environment.stage == "CODE")
parameterStore.get("/frontend/CODE/commercial.bundlePath")
else
parameterStore.get("/frontend/commercial.bundlePath")
}

private def updateBundlePath(): Unit = {
cachedBundlePath = "test_commercial_bundles/" + configuration.getMandatoryStringProperty("commercial.bundlePath")
cachedBundlePath = "test_commercial_bundles/" + bundlePathParameterValue
cachedTimestamp = Instant.now()
}

Expand Down

0 comments on commit f0958ea

Please sign in to comment.