From 2670abe8a844a20bfb0d3744be03f3c1b0fd0c15 Mon Sep 17 00:00:00 2001 From: Cody Cutrer Date: Mon, 10 Aug 2020 14:15:03 -0600 Subject: [PATCH] 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 Tested-by: Service Cloud Jenkins QA-Review: Cody Cutrer Product-Review: Cody Cutrer --- lib/fallback_memory_cache.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/fallback_memory_cache.rb b/lib/fallback_memory_cache.rb index ca417b7b4c0..2c2bf86a852 100644 --- a/lib/fallback_memory_cache.rb +++ b/lib/fallback_memory_cache.rb @@ -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