From 62ec39460c700a49dbfbf408aacccdf95ac00599 Mon Sep 17 00:00:00 2001 From: bsimpson63 Date: Sat, 31 Mar 2012 01:13:20 -0700 Subject: [PATCH] Start dual-writing spam_links and spam_comments. --- r2/r2/lib/db/queries.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/r2/r2/lib/db/queries.py b/r2/r2/lib/db/queries.py index b68d73002..59b989e5f 100644 --- a/r2/r2/lib/db/queries.py +++ b/r2/r2/lib/db/queries.py @@ -321,17 +321,17 @@ def _get_links(sr_id, sort, time): return res -def get_spam_links(sr): - q_l = Link._query(Link.c.sr_id == sr._id, - Link.c._spam == True, - sort = db_sort('new')) - return make_results(q_l) +@migrating_cached_query(SubredditQueryCache) +def get_spam_links(sr_id): + return Link._query(Link.c.sr_id == sr_id, + Link.c._spam == True, + sort = db_sort('new')) -def get_spam_comments(sr): - q_c = Comment._query(Comment.c.sr_id == sr._id, - Comment.c._spam == True, - sort = db_sort('new')) - return make_results(q_c) +@migrating_cached_query(SubredditQueryCache) +def get_spam_comments(sr_id): + return Comment._query(Comment.c.sr_id == sr_id, + Comment.c._spam == True, + sort = db_sort('new')) def get_spam(sr): if isinstance(sr, ModContribSR):