summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2021-04-02 10:09:19 +0200
committerDaniel Friesel <derf@finalrewind.org>2021-04-02 10:09:19 +0200
commitd273ecaaee8ddae3bf04016b43f63e2759104890 (patch)
tree934b1f9b05a786541abe0b204051dbbb0162aad0
parent0504a2fb00b164ded79251cd0ab56146870c5531 (diff)
skip trains which are likely not in transit yet
-rwxr-xr-xbin/lookup-server3
1 files changed, 3 insertions, 0 deletions
diff --git a/bin/lookup-server b/bin/lookup-server
index 8305305..d54f03d 100755
--- a/bin/lookup-server
+++ b/bin/lookup-server
@@ -110,6 +110,9 @@ class Train:
ts = stopover["arrival"]
if i == 0:
+ if ts > now and (ts - now).seconds > 300:
+ # train has not departed from its initial stop yet and is not about to depart
+ return
continue
prev_eva = int(self.stopovers[i - 1]["stop"]["id"])