Skip to content

Commit

Permalink
Startup: workaround db transporter bug in DEV mode
Browse files Browse the repository at this point in the history
  • Loading branch information
FroMage committed Jul 5, 2024
1 parent 15df8cc commit 0959c35
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main/java/util/Startup.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
import java.io.UncheckedIOException;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.time.temporal.ChronoUnit;
import java.time.temporal.TemporalUnit;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Optional;
Expand Down Expand Up @@ -91,6 +94,10 @@ public void start(@Observes StartupEvent evt) {
if(entity instanceof Speaker sp) {
// for testing stuff
sp.email = "[email protected]";
} else if(entity instanceof Slot slot) {
// FIXME: we have a bug where dates are shifted +2h from prod to dev for some reason
slot.startDate = Date.from(slot.startDate.toInstant().minus(2l, ChronoUnit.HOURS));
slot.endDate = Date.from(slot.endDate.toInstant().minus(2l, ChronoUnit.HOURS));
}
// FIXME: this is not nice
// remove the ID, to get a fresh entity
Expand Down

0 comments on commit 0959c35

Please sign in to comment.