remove unnecessary timeouts in cache.memoize
parent
cd8bdaa5fd
commit
3efa1dfb04
|
@ -353,7 +353,7 @@ def get_sub_by_name(sub:str, v:Optional[User]=None, graceful=False) -> Optional[
|
|||
else: abort(404)
|
||||
return sub
|
||||
|
||||
@cache.memoize(timeout=8640000)
|
||||
@cache.memoize()
|
||||
def get_profile_picture(identifier:Union[int, str]) -> str:
|
||||
if isinstance(identifier, int):
|
||||
x = get_account(identifier, graceful=True)
|
||||
|
|
|
@ -75,7 +75,7 @@ def front_all(v, sub=None, subdomain=None):
|
|||
|
||||
LIMITED_WPD_HOLES = ('gore', 'aftermath', 'selfharm', 'meta', 'discussion', 'social', 'music', 'request')
|
||||
|
||||
@cache.memoize(timeout=86400)
|
||||
@cache.memoize()
|
||||
def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, filter_words='', gt=0, lt=0, sub=None, site=None, pins=True, holes=True):
|
||||
posts = g.db.query(Submission)
|
||||
|
||||
|
@ -183,7 +183,7 @@ def random_user(v:User):
|
|||
|
||||
return redirect(f"/@{u}")
|
||||
|
||||
@cache.memoize(timeout=86400)
|
||||
@cache.memoize()
|
||||
def comment_idlist(v=None, page=1, sort="new", t="day", gt=0, lt=0, site=None):
|
||||
comments = g.db.query(Comment.id) \
|
||||
.outerjoin(Comment.post) \
|
||||
|
|
|
@ -24,7 +24,7 @@ def validate_formkey(u:User, formkey:Optional[str]) -> bool:
|
|||
if not formkey: return False
|
||||
return validate_hash(get_raw_formkey(u), formkey)
|
||||
|
||||
@cache.memoize(timeout=604800)
|
||||
@cache.memoize()
|
||||
def get_alt_graph_ids(uid:int) -> List[int]:
|
||||
alt_graph_cte = g.db.query(literal(uid).label('user_id')).select_from(Alt).cte('alt_graph', recursive=True)
|
||||
|
||||
|
|
|
@ -758,7 +758,7 @@ def visitors(v:User, username:str):
|
|||
|
||||
return render_template("userpage/views.html", v=v, u=u, views=views, next_exists=next_exists, page=page)
|
||||
|
||||
@cache.memoize(timeout=86400)
|
||||
@cache.memoize()
|
||||
def userpagelisting(user:User, site=None, v=None, page:int=1, sort="new", t="all"):
|
||||
if user.shadowbanned and not (v and v.can_see_shadowbanned): return []
|
||||
posts = g.db.query(Submission.id).filter_by(author_id=user.id, is_pinned=False)
|
||||
|
|
Loading…
Reference in New Issue