Ticket #5678: zero-cacheTime.diff

File zero-cacheTime.diff, 614 bytes (added by acidfoo, 4 years ago)
  • twisted/names/cache.py

     
    9595        if self.verbose > 1:
    9696            log.msg('Adding %r to cache' % query)
    9797
    98         self.cache[query] = (cacheTime or self._reactor.seconds(), payload)
     98        if cacheTime is None:
     99            self.cache[query] = (self._reactor.seconds(), payload)
     100        else:
     101            self.cache[query] = (cacheTime, payload)
    99102
    100103        if self.cancel.has_key(query):
    101104            self.cancel[query].cancel()