mirror of
https://github.com/google/nomulus.git
synced 2025-05-29 17:00:11 +02:00
Use lazy injection in SendEscrow command (#1086)
* Use lazy injection in SendEscrow command The injected object in SendEscrowReportToIcannCommand creates Ofy keys in its static initialization routine. This happens before the RemoteApi setup. Use lazy injection to prevent failure.
This commit is contained in:
parent
6c16ee7ae4
commit
13fd9971a9
1 changed files with 3 additions and 3 deletions
|
@ -16,6 +16,7 @@ package google.registry.tools;
|
||||||
|
|
||||||
import com.beust.jcommander.Parameter;
|
import com.beust.jcommander.Parameter;
|
||||||
import com.beust.jcommander.Parameters;
|
import com.beust.jcommander.Parameters;
|
||||||
|
import dagger.Lazy;
|
||||||
import google.registry.rde.RdeReporter;
|
import google.registry.rde.RdeReporter;
|
||||||
import google.registry.tools.params.PathParameter;
|
import google.registry.tools.params.PathParameter;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
|
@ -33,13 +34,12 @@ final class SendEscrowReportToIcannCommand implements CommandWithRemoteApi {
|
||||||
required = true)
|
required = true)
|
||||||
private List<Path> files;
|
private List<Path> files;
|
||||||
|
|
||||||
@Inject
|
@Inject Lazy<RdeReporter> rdeReporter;
|
||||||
RdeReporter rdeReporter;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() throws Exception {
|
public void run() throws Exception {
|
||||||
for (Path file : files) {
|
for (Path file : files) {
|
||||||
rdeReporter.send(Files.readAllBytes(file));
|
rdeReporter.get().send(Files.readAllBytes(file));
|
||||||
System.out.printf("Uploaded: %s\n", file);
|
System.out.printf("Uploaded: %s\n", file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue