in notificationworkerlambda/src/main/scala/com/gu/notifications/worker/Configuration.scala [114:143]
def fetchFirebase(): FcmWorkerConfiguration = {
val config = fetchConfiguration(confPrefixFromPlatform)
def getStringList(path: String): List[String] =
if (config.hasPath(path))
config.getString(path).split(",").toList
else
List()
def getOptionalInt(path: String, defVal: Int): Int =
if (config.hasPath(path))
config.getInt(path)
else
defVal
FcmWorkerConfiguration(
config.getString("cleaningSqsUrl"),
FcmConfig(
serviceAccountKey = config.getString("fcm.serviceAccountKey"),
connectTimeout = getOptionalInt("fcm.connectTimeout", 10),
requestTimeout = getOptionalInt("fcm.requestTimeout", 10),
debug = config.getBoolean("fcm.debug"),
dryRun = config.getBoolean("dryrun")
),
config.getInt("fcm.threadPoolSize"),
getOptionalInt("fcm.concurrencyForIndividualSend", 100),
concurrencyForMessages = getOptionalInt("fcm.concurrencyForMessages", 20),
httpClientPoolSize = getOptionalInt("fcm.httpClientPoolSize", 10)
)
}