shorter db sessions
This commit is contained in:
parent
ebc0b95022
commit
935f8d7f2b
4 changed files with 141 additions and 136 deletions
|
|
@ -123,7 +123,7 @@ def get_icon_app(id, type_, size, callback):
|
|||
from item.models import Item
|
||||
item = Item.get(id)
|
||||
if not item:
|
||||
callback('')
|
||||
data = ''
|
||||
else:
|
||||
if type_ == 'cover' and not item.meta.get('cover'):
|
||||
type_ = 'preview'
|
||||
|
|
@ -145,7 +145,7 @@ def get_icon_app(id, type_, size, callback):
|
|||
if size:
|
||||
data = icons[skey] = resize_image(data, size=size)
|
||||
data = bytes(data) or ''
|
||||
callback(data)
|
||||
callback(data)
|
||||
|
||||
class IconHandler(tornado.web.RequestHandler):
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue