mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-21 03:28:05 +01:00
Delete messages lazily on account and device deletion to prevent timeouts when deleting accounts/devices with large queues
This commit is contained in:
committed by
GitHub
parent
4ef6266e8f
commit
01743e5c88
@@ -67,6 +67,10 @@ public class DynamicConfiguration {
|
||||
@Valid
|
||||
DynamicMetricsConfiguration metricsConfiguration = new DynamicMetricsConfiguration(false);
|
||||
|
||||
@JsonProperty
|
||||
@Valid
|
||||
DynamicMessagesConfiguration messagesConfiguration = new DynamicMessagesConfiguration();
|
||||
|
||||
public Optional<DynamicExperimentEnrollmentConfiguration> getExperimentEnrollmentConfiguration(
|
||||
final String experimentName) {
|
||||
return Optional.ofNullable(experiments.get(experimentName));
|
||||
@@ -121,4 +125,8 @@ public class DynamicConfiguration {
|
||||
return metricsConfiguration;
|
||||
}
|
||||
|
||||
public DynamicMessagesConfiguration getMessagesConfiguration() {
|
||||
return messagesConfiguration;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Copyright 2024 Signal Messenger, LLC
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
package org.whispersystems.textsecuregcm.configuration.dynamic;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
public record DynamicMessagesConfiguration(@NotNull List<DynamoKeyScheme> dynamoKeySchemes) {
|
||||
public enum DynamoKeyScheme {
|
||||
TRADITIONAL,
|
||||
LAZY_DELETION;
|
||||
}
|
||||
|
||||
public DynamicMessagesConfiguration() {
|
||||
this(List.of(DynamoKeyScheme.TRADITIONAL));
|
||||
}
|
||||
|
||||
public DynamoKeyScheme writeKeyScheme() {
|
||||
return dynamoKeySchemes().getLast();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user