FIX: Topic Timer auto opening closed topics (PR #10524)

This commit is addressing an issue where it is possible that there could be multiple topic timer jobs running to close a topic or a weird race condition state causing a topic that was just closed to be re-opened.

By removing the logic from the Topic Timer model into the Topic Timer controller endpoint we isolate the code that is used for setting an auto-open or an auto-close timer to just that functionality making the topic timer background jobs safer if multiple are running.

Possibly in the future if we would like this logic back in the model a refactor will be needed where we actually pass in the auto-close and auto-open action instead of mixing it with the close and open action that is currently being passed to the controller.

GitHub

LGTM!

This commit is addressing an issue where it is possible that there could be multiple topic timer jobs running to close a topic or a weird race condition state causing a topic that was just closed to be re-opened.

I feel like we need to dig deeper into this and see if it is the design of the code that needs changing here. Perhaps we need a mutex? Or maybe we need to add some sort of uniqueness constraint to ensure that only a single open/close topic timer can exist for a topic.