Added 5 minutes to the range of events to get
Signed-off-by: Louis Vallat <louis@louis-vallat.xyz>
This commit is contained in:
parent
45e0fca849
commit
ac4f691c92
@ -21,4 +21,3 @@ CREATE TABLE IF NOT EXISTS events
|
|||||||
REFERENCES students (id)
|
REFERENCES students (id)
|
||||||
ON DELETE CASCADE
|
ON DELETE CASCADE
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@ public final class EventManager {
|
|||||||
public static List<Event> getNextEventsFromStudent(Student s) {
|
public static List<Event> getNextEventsFromStudent(Student s) {
|
||||||
logger.debug("Getting events from student '{}'.", s.getSnowflake());
|
logger.debug("Getting events from student '{}'.", s.getSnowflake());
|
||||||
String sql = "SELECT id, summary, start_event, end_event" +
|
String sql = "SELECT id, summary, start_event, end_event" +
|
||||||
" FROM events WHERE students_id = ? AND start_event >= NOW();";
|
" FROM events WHERE students_id = ? AND (start_event + interval '5 minutes') >= NOW();";
|
||||||
List<Event> events = new ArrayList<>();
|
List<Event> events = new ArrayList<>();
|
||||||
try (Connection connection = DBManager.getConnection()) {
|
try (Connection connection = DBManager.getConnection()) {
|
||||||
try (PreparedStatement stmt = connection.prepareStatement(sql)) {
|
try (PreparedStatement stmt = connection.prepareStatement(sql)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user