Fix 646a7e62: recalc_time was not scaled properly (#10901)

This caused "runtime" to underflow or, if you are lucky, hit an
assert in ScaleToMonthly when it hits zero. But mostly underflow.
This commit is contained in:
Patric Stout 2023-06-01 14:21:33 +02:00 committed by GitHub
parent b5b004e518
commit 9eda419f9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -50,7 +50,7 @@ void FlowMapper::Run(LinkGraphJob &job) const
/* Scale by time the graph has been running without being compressed. Add 1 to avoid
* division by 0 if spawn date == last compression date. This matches
* LinkGraph::Monthly(). */
uint runtime = job.JoinDate() - job.Settings().recalc_time - job.LastCompression() + 1;
uint runtime = job.JoinDate() - job.Settings().recalc_time / SECONDS_PER_DAY - job.LastCompression() + 1;
for (auto &it : flows) {
it.second.ScaleToMonthly(runtime);
}