Skip to content
This repository has been archived by the owner on Sep 14, 2018. It is now read-only.

Commit

Permalink
specify cache expiry
Browse files Browse the repository at this point in the history
  • Loading branch information
mastahyeti committed Apr 13, 2015
1 parent edd8ac8 commit dcd1086
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/labler.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ MY_TEAMS_REGEX = new RegExp "(#{MY_TEAMS.join('|')})"
# Private cache so we don't need to process every message every time.
CACHE = CacheService.getUserCache()
CACHE_VERSION = 1
CACHE_EXPIRY = 60 * 60 * 2

class Label
@all = {}
Expand Down Expand Up @@ -130,7 +131,7 @@ class Thread
#
# Returns nothing.
@dumpDoneToCache: ->
CACHE.put @doneKey, JSON.stringify(@done)
CACHE.put @doneKey, JSON.stringify(@done), CACHE_EXPIRY

# Archive all the messages in every thread.
#
Expand Down Expand Up @@ -222,7 +223,7 @@ class Message
@dumpReasonsToCache: ->
reasons = {}
reasons[k] = JSON.stringify(@all[k]._reason) for k in @keys when @all[k]._reason?
CACHE.putAll reasons
CACHE.putAll reasons, CACHE_EXPIRY

# Instantiate a new Message object.
#
Expand Down

0 comments on commit dcd1086

Please sign in to comment.