Kernel::TERMINATE event subscriber that is used right now for generating the reports is probably good for frontend performance, but is fired every time there is a request to Drupal, it means all ajax requests, image thumbnail generation request and so on.
Would not it be better to use DestructableInterface for the service instead? I think it has the same advantages as Kernel::TERMINATE subscriber, but is called only when the service was actually called.
Maybe I am wrong, it would be nice to here another opinion.
Attaching the patch here for now. Please review.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 3085785-4.patch | 6.05 KB | jsacksick |
Comments
Comment #2
a.dmitriiev commentedComment #3
andypostmaybe better to use queue or at least lock service to prevent race
Comment #4
jsacksick commentedI don't see a reason to use the state, attaching patch is getting rid of that, let's see if the tests are still passing.
Comment #6
jsacksick commentedWent ahead and committed the patch from #4.