Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,31 @@ public final class JobsPut {
*/
public static String createOrUpdateJob(final String partitionId, String jobId, NewJob job) throws Exception {
try {
LOG.info("RORY createOrUpdateJob: Creating or updating job with id '{}'...", jobId);
boolean roryLog = "true".equalsIgnoreCase(System.getenv().getOrDefault("RORY_LOG", "false"));
boolean roryWrite = !"false".equalsIgnoreCase(System.getenv().getOrDefault("RORY_WRITE", "true"));

if (roryLog) {
LOG.info(job.toString());
}

if (roryWrite) {
try {
String dirPath = "/etc/store/rory";
String filePath = dirPath + "/" + job.getName() + "_" + jobId + ".txt";

java.nio.file.Path dir = java.nio.file.Paths.get(dirPath);
java.nio.file.Files.createDirectories(dir); // Create directory if it doesn't exist

LOG.info("RORY Writing job to file '{}'...", filePath);
java.nio.file.Files.write(
java.nio.file.Paths.get(filePath),
job.toString().getBytes(java.nio.charset.StandardCharsets.UTF_8)
);
} catch (Exception e) {
LOG.warn("Failed to write job info to file: {}", e.getMessage(), e);
}
}
LOG.debug("createOrUpdateJob: Starting...");
ApiServiceUtil.validatePartitionId(partitionId);

Expand Down
10 changes: 5 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1145,18 +1145,18 @@
<module>job-service-db-client</module>
<module>job-service-dropwizard</module>
<module>job-service-core</module>
<module>job-service-unit-tests</module>
<!-- <module>job-service-unit-tests</module>-->
<module>job-service-internal-client</module>
<module>job-service-scheduled-executor</module>
<module>job-service-scheduled-executor-container</module>
<module>job-service-container</module>
<module>job-service-container-tests</module>
<module>job-service-testing-worker-shared</module>
<!-- <module>job-service-container-tests</module>-->
<!-- <module>job-service-testing-worker-shared</module>-->
<module>worker-jobtracking</module>
<module>worker-jobtracking-shared</module>
<module>worker-jobtracking-container</module>
<module>worker-jobtracking-container-tests</module>
<module>job-service-acceptance-tests</module>
<!-- <module>worker-jobtracking-container-tests</module>-->
<!-- <module>job-service-acceptance-tests</module>-->
<module>job-service-util</module>
</modules>

Expand Down