mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: use Discourse.cache over Rails.cache
Discourse.cache is a more consistent method to use and offers clean fallback if you are skipping redis This is part of a larger change that both optimizes Discoruse.cache and omits use of setex on $redis in favor of consistently using discourse cache Bench does reveal that use of Rails.cache and Discourse.cache is 1.25x slower than redis.setex / get so a re-implementation will follow prior to porting
This commit is contained in:
@@ -56,7 +56,7 @@ describe OneboxController do
|
||||
stub_request(:get, url).to_return(status: 200, body: html).then.to_raise
|
||||
|
||||
bypass_limiting
|
||||
Rails.cache.delete("onebox__#{url}")
|
||||
Discourse.cache.delete("onebox__#{url}")
|
||||
get "/onebox.json", params: { url: url }
|
||||
expect(response.status).to eq(200)
|
||||
expect(response.body).to include("Onebox1")
|
||||
|
||||
Reference in New Issue
Block a user