Browse Source

Cache tweets forever [again]

Now that we no longer have "??? users" (i.e. in no case can a
twist "look bad"), caching forever can boost things up seriously
*and* it's cool to see how someone's avatar changes over time :)
master
The Dod 11 years ago
parent
commit
969842e924
  1. 2
      twister.py

2
twister.py

@ -41,7 +41,7 @@ class Twister:
"reply":self._format_reply(p['userpost'].get('reply',{})), "reply":self._format_reply(p['userpost'].get('reply',{})),
}) })
return result return result
@functioncache(60*60,ignore_instance=True) # can't cache forever, because maybe user was a skip_cache, in that case it's snafu for an hour :( @functioncache(ignore_instance=True) # Cache forever. One day we'll look at our old avatars and remember how stupid we used to be.
def get_twist(self,username,k): def get_twist(self,username,k):
p = self.twister.dhtget(username,'post{0}'.format(k),'s') p = self.twister.dhtget(username,'post{0}'.format(k),'s')
if p: if p:

Loading…
Cancel
Save