Skip to content

Commit

Permalink
Merge pull request #33 from transcom/sns-publish-force-fix
Browse files Browse the repository at this point in the history
Fix sns force publish condition
  • Loading branch information
TevinAdams authored Oct 18, 2024
2 parents 170c069 + d1790ed commit 73d83e0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</parent>
<groupId>com.milmove.trdmlambda</groupId>
<artifactId>trdm-lambda</artifactId>
<version>1.0.3.21</version>
<version>1.0.3.22</version>
<name>trdm java spring interface</name>
<description>Project for deploying a Java TRDM interfacer for TGET data.</description>
<properties>
Expand Down
9 changes: 7 additions & 2 deletions src/main/java/com/milmove/trdmlambda/milmove/util/Trdm.java
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,11 @@ public void UpdateTGETData(XMLGregorianCalendar ourLastUpdate, String trdmTable,

boolean receivedData = false;

boolean forcePublish = false;
if (snsForcePublish != null && snsForcePublish.equals(Boolean.toString(true))) {
forcePublish = true;
}

while (ourLastUpdate.compare(trdmLastUpdate) <= 0 && !receivedData) {
XMLGregorianCalendar oneWeekLater = AddOneWeek(ourLastUpdate);
// Add check that our "One week later" addition doesn't go past the TRDM last
Expand Down Expand Up @@ -181,7 +186,7 @@ public void UpdateTGETData(XMLGregorianCalendar ourLastUpdate, String trdmTable,
databaseService.insertTransportationAccountingCodes(codes);
logger.info("finished inserting TACs into DB");

if (tacParser.getMalformedTacList().size() > 0 || snsForcePublish == "true") {
if (tacParser.getMalformedTacList().size() > 0 || forcePublish) {
try {
logger.info(
"malformed TAC data detected when parsing. Sending malformed TAC data SNS notification");
Expand All @@ -204,7 +209,7 @@ public void UpdateTGETData(XMLGregorianCalendar ourLastUpdate, String trdmTable,
databaseService.insertLinesOfAccounting(loas);
logger.info("finished inserting LOAs into DB");

if (loaParser.getMalformedLoaList().size() > 0 || snsForcePublish == "true") {
if (loaParser.getMalformedLoaList().size() > 0 || forcePublish) {
try {
logger.info(
"malformed LOA data detected when parsing. Sending malformed LOA data SNS notification");
Expand Down

0 comments on commit 73d83e0

Please sign in to comment.