diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 6ce9333..cdc0922 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -33,7 +33,8 @@ jobs: X_DOCKER_TAG: ${{ env.DOCKER_TAG }} X_JAVA_OPTIONS: -Xms128m -Xmx2048m X_JDBC_URL: ${{ secrets.TEST_JDBC_URL }} - X_OPERATION_MODE: "follow" + # X_OPERATION_MODE: "follow" + X_OPERATION_MODE: "month 2024 11" - name: Build project uses: noi-techpark/github-actions/maven-build@v2 diff --git a/src/main/java/it/bz/noi/a22traffic/BulkLoader.java b/src/main/java/it/bz/noi/a22traffic/BulkLoader.java index 19f518b..e2f1b99 100644 --- a/src/main/java/it/bz/noi/a22traffic/BulkLoader.java +++ b/src/main/java/it/bz/noi/a22traffic/BulkLoader.java @@ -95,7 +95,8 @@ public void run() { ins.setInt(8, Integer.parseInt(res.get(i).get("class"))); ins.setDouble(9, Double.parseDouble(res.get(i).get("speed"))); ins.setInt(10, Integer.parseInt(res.get(i).get("direction"))); - ins.setInt(11, Integer.parseInt(res.get(i).get("country"))); + String country = res.get(i).get("country"); + ins.setInt(11, country != null ? Integer.parseInt(country) : null); ins.setString(12, res.get(i).get("license_plate_initials")); ins.execute(); } diff --git a/src/main/java/it/bz/noi/a22traffic/Follower.java b/src/main/java/it/bz/noi/a22traffic/Follower.java index 68195d0..49bdb83 100644 --- a/src/main/java/it/bz/noi/a22traffic/Follower.java +++ b/src/main/java/it/bz/noi/a22traffic/Follower.java @@ -200,7 +200,8 @@ public static void fetchNew(Connector conn, String jdbc_url) throws IOException, pst.setInt(8, Integer.parseInt(res.get(i).get("class"))); pst.setDouble(9, Double.parseDouble(res.get(i).get("speed"))); pst.setInt(10, Integer.parseInt(res.get(i).get("direction"))); - pst.setInt(11, Integer.parseInt(res.get(i).get("country"))); + String country = res.get(i).get("country"); + pst.setInt(11, country != null ? Integer.parseInt(country) : null); pst.setString(12, res.get(i).get("license_plate_initials")); pst.execute(); }