Skip to content

Commit

Permalink
Respect run ID
Browse files Browse the repository at this point in the history
  • Loading branch information
triceo committed Oct 1, 2024
1 parent 83e8af2 commit 82c0037
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import java.time.Instant;
import java.time.ZoneId;
import java.util.Arrays;
import java.util.Objects;
import java.util.Optional;
import java.util.Properties;

Expand All @@ -54,14 +55,13 @@ public abstract class AbstractMain<C extends AbstractConfiguration> {

protected final Logger LOGGER = LoggerFactory.getLogger(getClass());
private final String subpackage;
private final String runId;
private final Path resultsDirectory;

protected AbstractMain(String subpackage) {
this.subpackage = subpackage;
var runId = System.getenv("RUN_ID");
this.runId = runId == null || runId.isBlank() ? getTimestamp() : runId.strip();
this.resultsDirectory = Path.of("results", subpackage, getTimestamp());
var runId = Objects.requireNonNullElse(System.getenv("RUN_ID"), getTimestamp())
.strip();
this.resultsDirectory = Path.of("results", subpackage, runId);
resultsDirectory.toFile().mkdirs();
}

Expand Down

0 comments on commit 82c0037

Please sign in to comment.