discourse/plugins/chat/lib
Martin Brennan 24ec06ff85
FEATURE: Reintroduce better thread reply counter cache (#21197)
This was reverted in 38cebd3ed5.
The issue was that I was using Discourse.redis.delete_prefixed
which does a slow redis KEYS lookup, which is not advised in
production. This commit removes that, and also ensures the periodical
thread count update only happens if threading is enabled.

I changed to use a redis INCR/DECR for reply count
cache. This avoids a round trip to redis to GET the current
count, and also avoids multi-process issues, where
if there's two processes trying to increment at the
same time, they may both receive the same value, add one
to it, then both write the same value back.
Then, it's only n+1 instead of n+2.

This also prevents almost all chat scheduled jobs from
running if chat is disabled, the only one remaining is
the message retention job.
2023-04-24 09:32:04 +10:00
..
chat FEATURE: Reintroduce better thread reply counter cache (#21197) 2023-04-24 09:32:04 +10:00
discourse_dev DEV: Reintroduce chat rake dev generate tasks (#21164) 2023-04-20 10:53:10 +10:00
email_controller_helper DEV: Move discourse-chat to the core repo. (#18776) 2022-11-02 10:41:30 -03:00
onebox/templates UX: update chat icon to d-chat (#20744) 2023-03-21 10:40:42 -04:00
tasks DEV: Reintroduce chat rake dev generate tasks (#21164) 2023-04-20 10:53:10 +10:00
service_runner.rb DEV: Move channel creation for category into service (#21167) 2023-04-24 09:15:16 +10:00