Skip to content

Commit

Permalink
fix unique bug, add mem_cache for taglist
Browse files Browse the repository at this point in the history
  • Loading branch information
Binux committed Nov 26, 2011
1 parent cd964af commit dccd81c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion db/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class User(Base, MySQLSettings):
__tablename__ = "user"

id = Column(Integer, primary_key=True)
email = Column(String(1024), unique=True)
email = Column(String(512), index=True)
name = Column(String(256))
group = Column(String(64))
permission = Column(Integer)
2 changes: 2 additions & 0 deletions handlers/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from tornado.web import HTTPError, UIModule
from tornado.options import options
from .base import BaseHandler
from libs.cache import mem_cache

TASK_LIMIT = 30

Expand Down Expand Up @@ -45,6 +46,7 @@ def render(self, tags):
return u", ".join(result)

class TagListModule(UIModule):
@mem_cache(2*60*60)
def render(self):
def size_type(count):
if count < 10:
Expand Down

0 comments on commit dccd81c

Please sign in to comment.