Skip to content

Commit 205058f

Browse files
authored
Use @Getter lombok annotation in PublicConfigurationService (#573)
1 parent 9887a93 commit 205058f

File tree

3 files changed

+11
-24
lines changed

3 files changed

+11
-24
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ All notable changes to this project will be documented in this file.
1414

1515
- Expose `workerWalletAddress` to avoid importing `CredentialsService` when not required. (#558)
1616
- Use `docker-java` from `iexec-commons-containers`. (#572)
17+
- Use `@Getter` lombok annotation in `PublicConfigurationService`. (#573)
1718

1819
### Dependency Upgrades
1920

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020 IEXEC BLOCKCHAIN TECH
2+
* Copyright 2020-2024 IEXEC BLOCKCHAIN TECH
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -23,9 +23,11 @@
2323
import com.iexec.resultproxy.api.ResultProxyClientBuilder;
2424
import com.iexec.worker.feign.CustomCoreFeignClient;
2525
import feign.Logger;
26+
import lombok.Getter;
2627
import org.springframework.context.annotation.Bean;
2728
import org.springframework.stereotype.Service;
2829

30+
@Getter
2931
@Service
3032
public class PublicConfigurationService {
3133

@@ -35,41 +37,25 @@ public PublicConfigurationService(CustomCoreFeignClient customCoreFeignClient) {
3537
this.publicConfiguration = customCoreFeignClient.getPublicConfiguration();
3638
}
3739

38-
public PublicConfiguration getPublicConfiguration() {
39-
return publicConfiguration;
40-
}
41-
42-
public String getBlockchainAdapterUrl() {
43-
return publicConfiguration.getBlockchainAdapterUrl();
44-
}
45-
46-
public String getWorkerPoolAddress() {
47-
return publicConfiguration.getWorkerPoolAddress();
48-
}
49-
5040
public String getSchedulerPublicAddress() {
5141
return publicConfiguration.getSchedulerPublicAddress();
5242
}
5343

54-
public long getAskForReplicatePeriod() {
55-
return publicConfiguration.getAskForReplicatePeriod();
56-
}
57-
58-
public String getResultRepositoryURL() {
59-
return publicConfiguration.getResultRepositoryURL();
60-
}
61-
6244
public String getRequiredWorkerVersion() {
6345
return publicConfiguration.getRequiredWorkerVersion();
6446
}
6547

6648
@Bean
6749
public BlockchainAdapterApiClient blockchainAdapterApiClient() {
68-
return BlockchainAdapterApiClientBuilder.getInstance(Logger.Level.NONE, getBlockchainAdapterUrl());
50+
return BlockchainAdapterApiClientBuilder.getInstance(
51+
Logger.Level.NONE,
52+
publicConfiguration.getBlockchainAdapterUrl());
6953
}
7054

7155
@Bean
7256
public ResultProxyClient resultProxyClient() {
73-
return ResultProxyClientBuilder.getInstance(Logger.Level.NONE, getResultRepositoryURL());
57+
return ResultProxyClientBuilder.getInstance(
58+
Logger.Level.NONE,
59+
publicConfiguration.getResultRepositoryURL());
7460
}
7561
}

src/main/java/com/iexec/worker/replicate/ReplicateDemandService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public ReplicateDemandService(IexecHubService iexecHubService,
6868
* than one replicate at the same time. The executor's queue is of size 1 to
6969
* avoid memory leak if the thread halts for any reason.
7070
*/
71-
@Scheduled(fixedDelayString = "#{publicConfigurationService.askForReplicatePeriod}")
71+
@Scheduled(fixedDelayString = "#{publicConfigurationService.publicConfiguration.askForReplicatePeriod}")
7272
void triggerAskForReplicate() {
7373
log.debug("Triggering ask for replicate action");
7474
AsyncUtils.runAsyncTask("ask-for-replicate", this::askForReplicate, executor);

0 commit comments

Comments
 (0)