Skip to content

Commit

Permalink
ensure correct upload file name
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewazores committed Oct 3, 2023
1 parent 391e3b8 commit 1cd5b02
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/main/java/io/cryostat/agent/CryostatClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -368,8 +368,7 @@ public CompletableFuture<Void> upload(
Instant start = Instant.now();
String timestamp = start.truncatedTo(ChronoUnit.SECONDS).toString().replaceAll("[-:]", "");
String fileName =
template.map(t -> String.format("%s_%s_%s.jfr", appName, t, timestamp))
.orElseGet(() -> String.format("%s_%s.jfr", appName, timestamp));
String.format("%s_%s_%s.jfr", appName, template.orElse("unknown"), timestamp);
Map<String, String> labels =
new HashMap<>(Map.of("jvmId", jvmId, "pushType", pushType.name()));
template.ifPresent(
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/io/cryostat/agent/harvest/Harvester.java
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ private Future<Void> uploadRecording(TemplatedRecording tr) throws IOException {
Path exitPath = exitPaths.get(tr);
return client.upload(
PushType.EMERGENCY,
Optional.of(tr.getConfiguration().getName()),
Optional.of(tr.getConfiguration().getName().toLowerCase()),
maxFiles,
exitPath);
}
Expand Down

0 comments on commit 1cd5b02

Please sign in to comment.