Skip to content

Commit

Permalink
Get meta data from config
Browse files Browse the repository at this point in the history
  • Loading branch information
GODrums committed Oct 20, 2024
1 parent 1b009ab commit 237578f
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,21 @@

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import de.tum.in.www1.hephaestus.admin.AdminService;

@Service
public class MetaService {
private static final Logger logger = LoggerFactory.getLogger(MetaService.class);

@Value("${monitoring.repositories}")
private String[] repositoriesToMonitor;
@Autowired
private AdminService adminService;

public MetaDataDTO getMetaData() {
logger.info("Getting meta data...");
return new MetaDataDTO(repositoriesToMonitor);
return new MetaDataDTO(
adminService.getAdminConfig().getRepositoriesToMonitor().stream().sorted().toArray(String[]::new));
}
}

0 comments on commit 237578f

Please sign in to comment.