-
Notifications
You must be signed in to change notification settings - Fork 555
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dont need lifecycle for parameter store
- Loading branch information
Showing
9 changed files
with
31 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package common | ||
|
||
import scala.concurrent.duration._ | ||
import org.joda.time.Instant | ||
import conf.Configuration | ||
|
||
object CommercialBundle { | ||
import GuardianConfiguration._ | ||
|
||
private var cachedBundlePath: String = | ||
"test_commercial_bundles/" + configuration.getMandatoryStringProperty("commercial.bundlePath") | ||
private var cachedTimestamp: Instant = Instant.now() | ||
private val cacheDuration: FiniteDuration = 1.minute | ||
|
||
private val assetHost = Configuration.assets.path | ||
|
||
private def updateBundlePath(): Unit = { | ||
cachedBundlePath = "test_commercial_bundles/" + configuration.getMandatoryStringProperty("commercial.bundlePath") | ||
cachedTimestamp = Instant.now() | ||
} | ||
|
||
private def bundlePath: String = { | ||
if (Instant.now().isAfter(cachedTimestamp.plus(cacheDuration.toMillis))) updateBundlePath() | ||
|
||
cachedBundlePath | ||
} | ||
|
||
def getBundleUrl: String = s"$assetHost$bundlePath" | ||
} |
26 changes: 0 additions & 26 deletions
26
common/app/common/commercial/CommercialBundleUrlAgent.scala
This file was deleted.
Oops, something went wrong.
32 changes: 0 additions & 32 deletions
32
common/app/common/commercial/CommercialBundleUrlLifecycle.scala
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters