From a37acd1f420bb0721ce9c5bbed345a56bac6a678 Mon Sep 17 00:00:00 2001 From: Katherine Date: Fri, 15 Dec 2023 13:37:35 -0500 Subject: [PATCH] Add ttl for braintree writes to onetime donation table --- service/config/sample.yml | 1 + .../textsecuregcm/WhisperServerService.java | 2 +- .../textsecuregcm/configuration/DynamoDbTables.java | 6 +++--- .../textsecuregcm/storage/OneTimeDonationsManager.java | 9 ++++++++- .../storage/OnetimeDonationsManagerTest.java | 2 ++ 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/service/config/sample.yml b/service/config/sample.yml index 9f0b48860..e03175117 100644 --- a/service/config/sample.yml +++ b/service/config/sample.yml @@ -104,6 +104,7 @@ dynamoDbTables: expiration: P30D # Duration of time until rows expire onetimeDonations: tableName: Example_OnetimeDonations + expiration: P90D phoneNumberIdentifiers: tableName: Example_PhoneNumberIdentifiers profiles: diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/WhisperServerService.java b/service/src/main/java/org/whispersystems/textsecuregcm/WhisperServerService.java index d270215f5..7c2d350d5 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/WhisperServerService.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/WhisperServerService.java @@ -549,7 +549,7 @@ public class WhisperServerService extends Application paymentId); } diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/storage/OnetimeDonationsManagerTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/storage/OnetimeDonationsManagerTest.java index f008c5fc1..1ab2bee52 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/storage/OnetimeDonationsManagerTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/storage/OnetimeDonationsManagerTest.java @@ -7,6 +7,7 @@ package org.whispersystems.textsecuregcm.storage; import static org.assertj.core.api.Assertions.assertThat; +import java.time.Duration; import java.time.Instant; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -21,6 +22,7 @@ public class OnetimeDonationsManagerTest { void beforeEach() { oneTimeDonationsManager = new OneTimeDonationsManager( DynamoDbExtensionSchema.Tables.ONETIME_DONATIONS.tableName(), + Duration.ofDays(90), DYNAMO_DB_EXTENSION.getDynamoDbAsyncClient()); }