If you select a railroad to calculate, then select another one before the first finishes, it should cancel the first one. However, it doesn't. You can experience this by selecting a railroad to calculate, then immediately selecting another. Getting the answer for the second one will take longer than expected, because the system waits for the first calculation to complete, discards it, then starts the second calculation.
This is because python-rq, which is used to queue the work behind the scenes, doesn't have a built-in way to kill the worker once it begins processing. There's a way to remove it from the queue, so this chain won't just keep building. But still.
This is unlikely to be a big issue for the most part, as you're often only checking a single railroad at a time, and even a mistake would likely not add a ton of time. But it does add some delay, which degrades the user experience.
If you select a railroad to calculate, then select another one before the first finishes, it should cancel the first one. However, it doesn't. You can experience this by selecting a railroad to calculate, then immediately selecting another. Getting the answer for the second one will take longer than expected, because the system waits for the first calculation to complete, discards it, then starts the second calculation.
This is because python-rq, which is used to queue the work behind the scenes, doesn't have a built-in way to kill the worker once it begins processing. There's a way to remove it from the queue, so this chain won't just keep building. But still.
This is unlikely to be a big issue for the most part, as you're often only checking a single railroad at a time, and even a mistake would likely not add a ton of time. But it does add some delay, which degrades the user experience.