Commit Graph
29 Commits
Author SHA1 Message Date
Daniel WaterworthandGitHub 7df39300bc DEV: Reduce duplication with DistributedMutex#clear_regex (#25795) 2024-02-21 14:19:04 -06:00
Daniel WaterworthandGitHub 368bb2e997 FIX: Cache keys should be strings (#25791)
* FIX: Cache keys should be strings

Otherwise, there are subtle bugs that don't show up with a single
process.
2024-02-21 10:55:48 -06:00
Joffrey JAFFEUXandGitHub 96a3663452 Revert "Revert "PERF: Cache each theme field value once (#23192)" (#23354)" (#23356)
This reverts commit da430ac6b2.
2023-08-31 14:12:03 -05:00
Joffrey JAFFEUXandGitHub da430ac6b2 Revert "PERF: Cache each theme field value once (#23192)" (#23354)
This reverts commit be042d5b69.
2023-08-31 19:04:43 +02:00
Daniel WaterworthandGitHub be042d5b69 PERF: Cache each theme field value once (#23192)
Previously, theme fields from components would be cached for each of
their parent themes.
2023-08-31 11:24:02 -05:00
Daniel WaterworthandGitHub 15b4aa11c4 FIX: Always clear caches after committing the current transaction (#22550)
Instead of having to remember every time, just always wait until the
current transaction (if it exists) has committed before clearing any
DistributedCache.

The only exception to this is caches that aren't caching things from
postgres.

This means we have to do the test setup after setting the test
transaction, because doing the test setup involves clearing caches.

Reapplying this - it now doesn't use after_commit if skip_db is set
2023-07-12 09:49:28 -05:00
Daniel WaterworthandGitHub faa8d17d2c Revert "FIX: Always clear caches after committing the current transaction" (#22493)
This reverts commit 8310c7842caeb7f56a56ff4a7469c9884c2473b1.

This was breaking precompilation.
2023-07-07 18:05:38 -05:00
Daniel WaterworthandGitHub 78453ad9a0 FIX: Always clear caches after committing the current transaction (#22491)
Instead of having to remember every time, just always wait until the
current transaction (if it exists) has committed before clearing any
DistributedCache.

The only exception to this is caches that aren't caching things from
postgres.

This means we have to do the test setup after setting the test
transaction, because doing the test setup involves clearing caches.
2023-07-07 14:24:56 -05:00
David Taylor 36af2edb8b DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
David TaylorandGitHub fa8985944e FIX: Handle nil values in DistributedCache#defer_get_set (#15978)
Themes often cache `nil` values in a DistributedCache. This bug meant that we were re-calculating some values on every request, AND triggering message-bus publishing on every request.

This fix should provide a significant performance improvement for busy sites.
2022-02-17 14:52:14 +00:00
Alan Guo Xiang Tan 8c3427ebf5 PERF: Defer setting of distributed cache in more spots.
See follow up commit for rational.

Follow-up to 32b08853ba
2021-06-04 09:13:18 +08:00
Alan Guo Xiang Tan 32b08853ba PERF: Defer setting of distributed cache in performance critical paths.
Setting a key/value pair in DistributedCache involves waiting on the
write to Redis to finish. In most cases, we don't need to wait on the
setting of the cache to finish. We just need to take our return value
and move on.
2021-06-03 09:30:52 +08:00
Neil Lalonde 5c414b524d REFACTOR: distributed_cache is moved to the message_bus gem 2018-10-15 15:01:45 -04:00
Sam 13e79ae110 FIX: support Arrays with Marshal dump in distributed cache
Theme cache uses arrays here
2018-08-08 16:44:56 +10:00
Guo Xiang Tan 6aa44ac7b5 Allow DistributedCache#delete to not publish changes. 2017-10-20 23:03:42 +08:00
Guo Xiang Tan c0f9be4718 FIX: DistributedCache without namespace mode wasn't working. 2017-10-20 22:32:41 +08:00
Guo Xiang Tan a315860ea5 Make PostgreSQL failover work with distributed cache. 2017-10-20 17:15:29 +08:00
Sam 4def8f747a Correct flaky distributed cache test
make distributed cache more testable
2017-08-01 16:11:48 -04:00
Guo Xiang TanandGitHub 5269b652cd Add rubocop to our build. (#5004) 2017-07-28 10:20:09 +09:00
Sam Saffron 05269df80f FIX: DistributedCache would fail serialization in some cases 2016-01-30 09:01:15 +11:00
Sam Saffron 6ca04edbaa FEATURE: allow distributed cache to handle Set as value 2015-06-10 06:13:36 +10:00
Sam 60c4510da6 FIX: upgrade resilient distributed cache
only load messages in distributed cache if discourse version matches
2015-05-22 11:22:12 +10:00
Sam 1c844df127 MessageBus handles readonly redis now, no need to wrap it 2015-05-04 12:21:00 +10:00
Sam ffed3ab3ae FIX: distributed cache failing to clear certain values sometimes
this makes the cache resilient to cross machine / forking concerns
2015-05-01 15:25:23 +10:00
Robin Ward 2f0292d8dc Don't blow up if Redis switches to READONLY 2015-04-24 14:37:16 -04:00
Régis Hanol 2bfd447e15 FEATURE: custom emojis 2014-12-23 01:12:26 +01:00
Sam 969de57ccd FIX: distributed cache leak and potential infinite loop 2014-11-13 18:31:42 +11:00
Sam c0a69ca06f only publish distributed cache to user_id -1 2014-11-12 09:58:20 +11:00
Sam 53a57468dd PERF: distributed cache class to help sync caches between processes 2014-11-12 09:44:44 +11:00