File tree Expand file tree Collapse file tree
main/scala/com/gu/facia/client
test/scala/com/gu/facia/client Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ name := "facia-api-client"
66
77description := " Scala client for The Guardian's Facia JSON API"
88
9- ThisBuild / scalaVersion := " 2.13.15 "
9+ ThisBuild / scalaVersion := " 2.13.16 "
1010
1111val sonatypeReleaseSettings = Seq (
1212 releaseVersion := fromAggregatedAssessedCompatibilityWithLatestRelease().value,
@@ -26,8 +26,7 @@ val sonatypeReleaseSettings = Seq(
2626def artifactProducingSettings (supportScala3 : Boolean ) = Seq (
2727 organization := " com.gu" ,
2828 licenses := Seq (License .Apache2 ),
29- resolvers ++= Resolver .sonatypeOssRepos(" releases" ),
30- crossScalaVersions := Seq (scalaVersion.value) ++ (if (supportScala3) Seq (" 3.3.3" ) else Seq .empty),
29+ crossScalaVersions := Seq (scalaVersion.value) ++ (if (supportScala3) Seq (" 3.3.6" ) else Seq .empty),
3130 scalacOptions := Seq (
3231 " -release:8" ,
3332 " -feature" ,
Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ package com.gu.facia.client
22
33import com .gu .etagcaching .FreshnessPolicy .AlwaysWaitForRefreshedValue
44import com .gu .etagcaching .aws .s3 .{ObjectId , S3ByteArrayFetching }
5- import com .gu .etagcaching .fetching .Fetching
65import com .gu .etagcaching .{ConfigCache , ETagCache }
76import com .gu .facia .client .models .{CollectionJson , ConfigJson }
87import play .api .libs .json .{Format , Json }
Original file line number Diff line number Diff line change @@ -18,18 +18,18 @@ import scala.util.hashing.MurmurHash3
1818object FakeS3Fetching extends S3ByteArrayFetching with ResourcesHelper {
1919 private def pretendETagFor (bytes : Array [Byte ]): String = MurmurHash3 .bytesHash(bytes).toHexString
2020
21- override def fetch (objectId : ObjectId )( implicit ec : ExecutionContext ) : Future [MissingOrETagged [Array [Byte ]]] = Future {
21+ override def fetch (objectId : ObjectId ): Future [MissingOrETagged [Array [Byte ]]] = Future .successful {
2222 slurpBytes(objectId.key).fold(Missing : MissingOrETagged [Array [Byte ]]) { bytes =>
2323 ETaggedData (pretendETagFor(bytes), bytes)
2424 }
2525 }
2626
27- override def fetchOnlyIfETagChanged (objectId : ObjectId , oldETag : String )( implicit ec : ExecutionContext ) : Future [Option [MissingOrETagged [Array [Byte ]]]] = {
27+ override def fetchOnlyIfETagChanged (objectId : ObjectId , oldETag : String ): Future [Option [MissingOrETagged [Array [Byte ]]]] = {
2828 fetch(objectId).map {
29- case taggedData : ETaggedData [_ ] =>
29+ case taggedData : ETaggedData [Array [ Byte ] ] =>
3030 Option .unless(oldETag == taggedData.eTag)(taggedData) // simulate a Not-Modified response, if there's no change in ETag
3131 case x => Some (x)
32- }
32+ }( ExecutionContext .parasitic)
3333 }
3434}
3535
Original file line number Diff line number Diff line change 1- sbt.version =1.10.1
1+ sbt.version =1.11.5
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import sbt._
22
33object Dependencies {
44 val capiVersion = " 35.0.0"
5- val eTagCachingVersion = " 7 .0.0"
5+ val eTagCachingVersion = " 11 .0.0-PREVIEW.rearrange-executioncontexts.2025-09-04T1417.81632f48 "
66
77 val awsS3SdkV1 = " com.amazonaws" % " aws-java-sdk-s3" % " 1.12.765"
88 val eTagCachingS3Base = " com.gu.etag-caching" %% " aws-s3-base" % eTagCachingVersion
You can’t perform that action at this time.
0 commit comments