fix flaky assignment specs

0 means 0, not "approximately 0" for caching role override stuff

Change-Id: Ic3b3cf44b8477fd6f61754fa31c51885a38b0b62
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244679
Reviewed-by: Aaron Ogata <aogata@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
This commit is contained in:
Cody Cutrer 2020-08-10 14:15:03 -06:00
parent 4ff0aca3c4
commit 2670abe8a8
1 changed files with 5 additions and 0 deletions

View File

@ -18,6 +18,11 @@
class FallbackMemoryCache < ActiveSupport::Cache::MemoryStore
KEY_SUFFIX = '__no_expire'.freeze
def fetch(*, expires_in: nil)
return yield if expires_in == 0
super
end
def fetch_without_expiration(key)
fetch(key + KEY_SUFFIX)
end