Skip to content

Commit 47bfc27

Browse files
clean up
1 parent 91f5b18 commit 47bfc27

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

src/main/java/com/conveyal/datatools/manager/models/Deployment.java

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -446,17 +446,12 @@ public byte[] generateBuildConfig() throws IOException {
446446
}
447447

448448
public String generateBuildConfigAsString() {
449-
if (customBuildConfig != null) return customBuildConfig;
450-
return null;
451-
}
452-
453-
/** Convenience method to write serializable object (primarily for router/build config objects) to byte array. */
454-
private <O extends Serializable> byte[] writeToBytes(O object) {
455449
try {
456-
return otpConfigMapper.writer().writeValueAsBytes(object);
457-
} catch (JsonProcessingException e) {
458-
LOG.error("Value contains malformed JSON", e);
459-
return null;
450+
return new String(generateBuildConfig(), StandardCharsets.UTF_8);
451+
// TODO: Correctly generate default build config
452+
} catch (Exception e) {
453+
LOG.error("Failed to generate build config: ", e);
454+
return "";
460455
}
461456
}
462457

@@ -486,7 +481,8 @@ public byte[] generateRouterConfig() throws IOException {
486481
public String generateRouterConfigAsString() {
487482
try {
488483
return new String(generateRouterConfig(), StandardCharsets.UTF_8);
489-
} catch (IOException e) {
484+
// TODO: Correctly generate default router config
485+
} catch (Exception e) {
490486
LOG.error("Failed to generate router config: ", e);
491487
return "";
492488
}

src/main/java/com/conveyal/datatools/manager/models/OtpBuildConfig.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
/**
88
* Created by demory on 3/8/15.
9+
*
10+
* TODO: Figure out how to remove this class without causing problems in the DB migration
911
*/
1012
@JsonIgnoreProperties(ignoreUnknown = true)
1113
public class OtpBuildConfig implements Serializable {

src/main/java/com/conveyal/datatools/manager/models/OtpRouterConfig.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
/**
99
* Created by demory on 3/8/15.
10+
*
11+
* TODO: Figure out how to remove this class without causing problems in the DB migration
1012
*/
1113
@JsonIgnoreProperties(ignoreUnknown = true)
1214
public class OtpRouterConfig implements Serializable {

0 commit comments

Comments
 (0)