mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 13:41:16 +08:00
PERF: Use Redis SET EX GET
instead of LUA script for counting (#15939)
This will prevent Discourse from booting on Redis < 6.2.0
This commit is contained in:

committed by
GitHub

parent
a48231041b
commit
4d3da70bc6
@ -32,13 +32,13 @@ describe WebCrawlerRequest do
|
||||
inc('Googlebot')
|
||||
|
||||
Discourse.redis.without_namespace.stubs(:incr).raises(Redis::CommandError.new("READONLY"))
|
||||
Discourse.redis.without_namespace.stubs(:eval).raises(Redis::CommandError.new("READONLY"))
|
||||
Discourse.redis.without_namespace.stubs(:set).raises(Redis::CommandError.new("READONLY"))
|
||||
|
||||
inc('Googlebot', autoflush: 3)
|
||||
WebCrawlerRequest.write_cache!
|
||||
|
||||
Discourse.redis.without_namespace.unstub(:incr)
|
||||
Discourse.redis.without_namespace.unstub(:eval)
|
||||
Discourse.redis.without_namespace.unstub(:set)
|
||||
|
||||
inc('Googlebot', autoflush: 3)
|
||||
expect(web_crawler_request('Googlebot').count).to eq(3)
|
||||
|
Reference in New Issue
Block a user