mirror of
https://github.com/google/nomulus.git
synced 2025-07-06 11:13:35 +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
1cc8af4acd
commit
98d259449b
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.Parameters;
|
||||
import dagger.Lazy;
|
||||
import google.registry.rde.RdeReporter;
|
||||
import google.registry.tools.params.PathParameter;
|
||||
import java.nio.file.Files;
|
||||
|
@ -33,13 +34,12 @@ final class SendEscrowReportToIcannCommand implements CommandWithRemoteApi {
|
|||
required = true)
|
||||
private List<Path> files;
|
||||
|
||||
@Inject
|
||||
RdeReporter rdeReporter;
|
||||
@Inject Lazy<RdeReporter> rdeReporter;
|
||||
|
||||
@Override
|
||||
public void run() throws Exception {
|
||||
for (Path file : files) {
|
||||
rdeReporter.send(Files.readAllBytes(file));
|
||||
rdeReporter.get().send(Files.readAllBytes(file));
|
||||
System.out.printf("Uploaded: %s\n", file);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue