Skip to content

Commit

Permalink
fixup! refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewazores committed May 9, 2024
1 parent 695cd9d commit 8ed6323
Showing 1 changed file with 3 additions and 16 deletions.
19 changes: 3 additions & 16 deletions src/main/java/io/cryostat/events/S3TemplateService.java
Original file line number Diff line number Diff line change
Expand Up @@ -110,24 +110,11 @@ void onStart(@Observes StartupEvent evt) {
.filter(Files::isReadable)
.forEach(
p -> {
try (var parse = Files.newInputStream(p)) {
var template = (createTemplate(parseXml(parse)));
if (existing.stream()
.anyMatch(
t ->
Objects.equals(
t.getName(),
template.getName()))) {
return;
}
try (var is = Files.newInputStream(p)) {
logger.debugv(
"Uploading template {0} from {1} to S3",
template.getName(), p.toString());
try (var is = Files.newInputStream(p)) {
addTemplate(is);
}
"Uploading template from {0} to S3", p.toString());
addTemplate(is);
} catch (IOException
| ParseException
| InvalidXmlException
| InvalidEventTemplateException e) {
logger.warn(e);
Expand Down

0 comments on commit 8ed6323

Please sign in to comment.