Skip to content

Commit

Permalink
log cache activity
Browse files Browse the repository at this point in the history
  • Loading branch information
retorquere committed May 29, 2015
1 parent 5e8ca81 commit e7043f8
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions chrome/content/zotero-better-bibtex/cache.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ Zotero.BetterBibTeX.cache = new class
record = @record(itemID, context)
cached = @cache.findOne(record)
@access.insert(record) if cached && !@access.findOne(record)
Zotero.BetterBibTeX.debug("cache fetch for #{itemID}", if cached then 'hit' else 'miss')
Zotero.BetterBibTeX.debug("cache fetch", (if cached then 'hit' else 'miss'), 'for', Zotero.BetterBibTeX.log.object(record))
return cached

store: (itemID, context, citekey, bibtex) ->
Expand All @@ -174,13 +174,12 @@ Zotero.BetterBibTeX.cache = new class
cached.bibtex = bibtex
cached.lastaccess = Date.now()
@cache.update(cached)
Zotero.BetterBibTeX.debug("cache store for #{itemID}: replace")
else
record.citekey = citekey
record.bibtex = bibtex
record.lastaccess = Date.now()
@cache.insert(record)
Zotero.BetterBibTeX.debug("cache store for #{itemID}: insert")
Zotero.BetterBibTeX.debug('cache', (if cached then 'replace' else 'insert'), 'for', Zotero.BetterBibTeX.log.object(record))

Zotero.BetterBibTeX.auto = new class
constructor: ->
Expand Down

0 comments on commit e7043f8

Please sign in to comment.