Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 23 additions & 16 deletions core/src/main/java/google/registry/batch/ResaveEntityAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,22 +73,29 @@ public class ResaveEntityAction implements Runnable {
public void run() {
logger.atInfo().log(
"Re-saving entity %s which was enqueued at %s.", resourceKey, requestedTime);
tm().transact(
() -> {
Optional<EppResource> entity =
tm().loadByKeyIfPresent(VKey.createEppVKeyFromString(resourceKey));
if (entity.isEmpty()) {
logger.atSevere().log(
"Could not re-save entity %s because it does not exist; failing permanently.",
resourceKey);
return;
}
tm().put(entity.get().cloneProjectedAtTime(tm().getTxTime()));
if (!resaveTimes.isEmpty()) {
asyncTaskEnqueuer.enqueueAsyncResave(
VKey.createEppVKeyFromString(resourceKey), requestedTime, resaveTimes);
}
});
VKey<EppResource> entityKey = VKey.createEppVKeyFromString(resourceKey);
Optional<Instant> resavedAt =
tm().transact(
() -> {
Optional<EppResource> entity = tm().loadByKeyIfPresent(entityKey);
if (entity.isEmpty()) {
logger.atSevere().log(
"Could not re-save entity %s because it does not exist; failing"
+ " permanently.",
resourceKey);
return Optional.empty();
}
Instant now = tm().getTxTime();
tm().put(entity.get().cloneProjectedAtTime(now));
return Optional.of(now);
});
resavedAt.ifPresent(
now -> {
ImmutableSortedSet<Instant> remainingResaveTimes = resaveTimes.tailSet(now, false);
if (!remainingResaveTimes.isEmpty()) {
asyncTaskEnqueuer.enqueueAsyncResave(entityKey, now, remainingResaveTimes);
}
});
response.setPayload("Entity re-saved.");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import google.registry.eppserver.handler.EppServiceHandler;
import google.registry.eppserver.quota.EppServerQuotaManager;
import google.registry.networking.handler.SslServerInitializer;
import google.registry.networking.module.CertificateSupplierModule.TlsCredentials;
import google.registry.quota.NoopQuotaManager;
import google.registry.quota.QuotaManager;
import google.registry.quota.ValkeyQuotaManager;
Expand All @@ -40,8 +41,6 @@
import jakarta.inject.Qualifier;
import jakarta.inject.Singleton;
import java.io.IOException;
import java.security.PrivateKey;
import java.security.cert.X509Certificate;
import java.util.Optional;
import java.util.function.Supplier;
import redis.clients.jedis.UnifiedJedis;
Expand Down Expand Up @@ -130,11 +129,8 @@ static byte[] provideHelloBytes() {
@Provides
@EppProtocol
static SslServerInitializer<NioSocketChannel> provideSslServerInitializer(
SslProvider sslProvider,
Supplier<PrivateKey> privateKeySupplier,
Supplier<ImmutableList<X509Certificate>> certificatesSupplier) {
return new SslServerInitializer<>(
true, false, sslProvider, privateKeySupplier, certificatesSupplier);
SslProvider sslProvider, Supplier<TlsCredentials> tlsCredentialsSupplier) {
return new SslServerInitializer<>(true, false, sslProvider, tlsCredentialsSupplier);
}

@Provides
Expand Down
Loading
Loading