summaryrefslogtreecommitdiff
path: root/src/linkgraph
diff options
context:
space:
mode:
authorNicolas Chappe <74881848+nchappe@users.noreply.github.com>2021-08-18 17:06:22 +0200
committerMichael Lutz <michi@icosahedron.de>2021-08-20 22:37:03 +0200
commitb83820e7238a15b385b5aac51d7f29aef8f30bef (patch)
treee978f0e9a5c4e6c957273e404072dfd41adcc9fe /src/linkgraph
parentdd3acccb1b1cea232a6ea37180a8665b4f1016ac (diff)
downloadopenttd-b83820e7238a15b385b5aac51d7f29aef8f30bef.tar.xz
Change: [Linkgraph] Delete links only served by vehicles stopped in depot
A stale link is not deleted if the link refresher finds a vehicle that still serves it. This commit excludes vehicles stopped in depot for a very long time from the link refresher, so that their stale links can be deleted.
Diffstat (limited to 'src/linkgraph')
-rw-r--r--src/linkgraph/linkgraph.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/linkgraph/linkgraph.h b/src/linkgraph/linkgraph.h
index 3a2c37977..3c5aee872 100644
--- a/src/linkgraph/linkgraph.h
+++ b/src/linkgraph/linkgraph.h
@@ -447,6 +447,9 @@ public:
/** Minimum effective distance for timeout calculation. */
static const uint MIN_TIMEOUT_DISTANCE = 32;
+ /** Number of days before deleting links served only by vehicles stopped in depot. */
+ static const uint STALE_LINK_DEPOT_TIMEOUT = 1024;
+
/** Minimum number of days between subsequent compressions of a LG. */
static const uint COMPRESSION_INTERVAL = 256;