Skip to content
This repository has been archived by the owner on Sep 15, 2023. It is now read-only.

Commit

Permalink
change foreign rules sync schedule
Browse files Browse the repository at this point in the history
  • Loading branch information
gstoehld committed Mar 25, 2022
1 parent 38a1c4c commit 326caa3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public void valueSetCleanCron() {
valueSetDataService.deleteOldValueSets();
}

@Scheduled(cron = "${foreign-rules.sync.cron:0 0 0 ? * *}")
@Scheduled(cron = "${foreign-rules.sync.cron:0 39 * ? * *}")
@SchedulerLock(name = "foreign_rules_sync", lockAtLeastFor = "PT15S")
public void foreignRulesSyncCron() {
LockAssert.assertLocked();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public ForeignRulesControllerV2(
this.valueSetDataService = valueSetDataService;
}

@GetMapping(value = "/countries")
@GetMapping(value = "/foreignRules")
public @ResponseBody ResponseEntity<List<String>> getCountries(WebRequest request) {
return ResponseEntity.ok(foreignRulesDataService.getCountries());
}
Expand All @@ -62,6 +62,9 @@ public ForeignRulesControllerV2(

// Add rules to output
var foreignRules = foreignRulesDataService.getRulesForCountry(country);
if(foreignRules.isEmpty()){
return ResponseEntity.notFound().build();
}

var rules =
foreignRules.stream()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class ForeignRulesControllerV2Test extends BaseControllerTest {
protected MediaType acceptMediaType = MediaType.APPLICATION_JSON;

private String atRulesUrl = "/trust/v2/foreignRules/AT";
private String countryListUrl = "/trust/v2/countries";
private String countryListUrl = "/trust/v2/foreignRules";

@BeforeAll
static void setup(){
Expand Down

0 comments on commit 326caa3

Please sign in to comment.