forgejo/modules/cache
Jason Song 5b1990b3b2
Increase cacheContextLifetime to reduce false reports (#32011)
Replace #32001.

To prevent the context cache from being misused for long-term work
(which would result in using invalid cache without awareness), the
context cache is designed to exist for a maximum of 10 seconds. This
leads to many false reports, especially in the case of slow SQL.

This PR increases it to 5 minutes to reduce false reports.

5 minutes is not a very safe value, as a lot of changes may have
occurred within that time frame. However, as far as I know, there has
not been a case of misuse of context cache discovered so far, so I think
5 minutes should be OK.

Please note that after this PR, if warning logs are found again, it
should get attention, at that time it can be almost 100% certain that it
is a misuse.

(cherry picked from commit a323a82ec4bde6ae39b97200439829bf67c0d31e)
2024-09-14 17:09:03 +02:00
..
cache.go [CHORE] Move cache library 2024-08-27 21:28:56 +02:00
cache_redis.go [FEAT] Only implement used API of Redis client 2024-08-30 04:33:15 +02:00
cache_test.go Add testifylint to lint checks (#4535) 2024-07-30 19:41:10 +00:00
cache_twoqueue.go [CHORE] Move cache library 2024-08-27 21:28:56 +02:00
context.go Increase cacheContextLifetime to reduce false reports (#32011) 2024-09-14 17:09:03 +02:00
context_test.go Increase cacheContextLifetime to reduce false reports (#32011) 2024-09-14 17:09:03 +02:00