diff options
Diffstat (limited to 'lib/utils.coffee')
| -rw-r--r-- | lib/utils.coffee | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/utils.coffee b/lib/utils.coffee index 93045f32..d4beff03 100644 --- a/lib/utils.coffee +++ b/lib/utils.coffee @@ -323,10 +323,11 @@ class SimpleCache null rotate: (force = false) -> - if force or @entries < Object.keys(@cache).length or @expiry < new Date() - @lastRotation - @lastRotation = new Date() - @previous = @cache - @cache = {} + Utils.nextTick => + if force or @entries < Object.keys(@cache).length or @expiry < new Date() - @lastRotation + @lastRotation = new Date() + @previous = @cache + @cache = {} clear: -> @rotate true |
