From 47bfc275608a9380db30ba621ccca5dc8efe78d4 Mon Sep 17 00:00:00 2001 From: miles-grant-ibi Date: Tue, 17 Dec 2024 11:01:08 -0500 Subject: [PATCH] clean up --- .../datatools/manager/models/Deployment.java | 18 +++++++----------- .../manager/models/OtpBuildConfig.java | 2 ++ .../manager/models/OtpRouterConfig.java | 2 ++ 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/conveyal/datatools/manager/models/Deployment.java b/src/main/java/com/conveyal/datatools/manager/models/Deployment.java index 4fe7ebb92..7186eef39 100644 --- a/src/main/java/com/conveyal/datatools/manager/models/Deployment.java +++ b/src/main/java/com/conveyal/datatools/manager/models/Deployment.java @@ -446,17 +446,12 @@ public byte[] generateBuildConfig() throws IOException { } public String generateBuildConfigAsString() { - if (customBuildConfig != null) return customBuildConfig; - return null; - } - - /** Convenience method to write serializable object (primarily for router/build config objects) to byte array. */ - private byte[] writeToBytes(O object) { try { - return otpConfigMapper.writer().writeValueAsBytes(object); - } catch (JsonProcessingException e) { - LOG.error("Value contains malformed JSON", e); - return null; + return new String(generateBuildConfig(), StandardCharsets.UTF_8); + // TODO: Correctly generate default build config + } catch (Exception e) { + LOG.error("Failed to generate build config: ", e); + return ""; } } @@ -486,7 +481,8 @@ public byte[] generateRouterConfig() throws IOException { public String generateRouterConfigAsString() { try { return new String(generateRouterConfig(), StandardCharsets.UTF_8); - } catch (IOException e) { + // TODO: Correctly generate default router config + } catch (Exception e) { LOG.error("Failed to generate router config: ", e); return ""; } diff --git a/src/main/java/com/conveyal/datatools/manager/models/OtpBuildConfig.java b/src/main/java/com/conveyal/datatools/manager/models/OtpBuildConfig.java index 4ee8471b4..d0f385ef4 100644 --- a/src/main/java/com/conveyal/datatools/manager/models/OtpBuildConfig.java +++ b/src/main/java/com/conveyal/datatools/manager/models/OtpBuildConfig.java @@ -6,6 +6,8 @@ /** * Created by demory on 3/8/15. + * + * TODO: Figure out how to remove this class without causing problems in the DB migration */ @JsonIgnoreProperties(ignoreUnknown = true) public class OtpBuildConfig implements Serializable { diff --git a/src/main/java/com/conveyal/datatools/manager/models/OtpRouterConfig.java b/src/main/java/com/conveyal/datatools/manager/models/OtpRouterConfig.java index 6be7d51e4..da2d1961d 100644 --- a/src/main/java/com/conveyal/datatools/manager/models/OtpRouterConfig.java +++ b/src/main/java/com/conveyal/datatools/manager/models/OtpRouterConfig.java @@ -7,6 +7,8 @@ /** * Created by demory on 3/8/15. + * + * TODO: Figure out how to remove this class without causing problems in the DB migration */ @JsonIgnoreProperties(ignoreUnknown = true) public class OtpRouterConfig implements Serializable {