mirror of
https://github.com/discourse/discourse.git
synced 2025-02-24 01:31:54 +08:00

A previous refactor of the `Service::Base::Step` class introduced a non thread-safe behavior. `#call` mutates instance variables at runtime, and since a step instance is the same for any given service class, this can sometimes lead to `context` being the wrong one for the running service. This patch makes use of `Concurrent::ThreadLocalVar` to fix the issue.