mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-04-27 03:00:12 -04:00
missing except block in share, cache cleanup, and example.ini updates
This commit is contained in:
@@ -13,6 +13,7 @@ proxy_addr =
|
||||
log_path =
|
||||
|
||||
memcaches = 127.0.0.1:11211
|
||||
permacaches = 127.0.0.1:11211
|
||||
rec_cache = 127.0.0.1:11311
|
||||
tracker_url =
|
||||
adtracker_url =
|
||||
@@ -55,8 +56,7 @@ timezone = UTC
|
||||
monitored_servers = localhost
|
||||
|
||||
#query cache settings
|
||||
query_caches = 127.0.0.1:11211
|
||||
num_query_queue_workers =
|
||||
num_query_queue_workers = 0
|
||||
query_queue_worker =
|
||||
enable_doquery = False
|
||||
use_query_cache = False
|
||||
|
||||
@@ -55,12 +55,12 @@ class Globals(object):
|
||||
|
||||
tuple_props = ['memcaches',
|
||||
'rec_cache',
|
||||
'permacaches',
|
||||
'admins',
|
||||
'monitored_servers',
|
||||
'default_srs',
|
||||
'agents',
|
||||
'allowed_css_linked_domains',
|
||||
'query_caches']
|
||||
'allowed_css_linked_domains']
|
||||
|
||||
def __init__(self, global_conf, app_conf, paths, **extra):
|
||||
"""
|
||||
@@ -109,9 +109,9 @@ class Globals(object):
|
||||
# initialize caches
|
||||
mc = Memcache(self.memcaches)
|
||||
self.cache = CacheChain((LocalCache(), mc))
|
||||
self.permacache = Memcache(self.permacaches)
|
||||
|
||||
self.rec_cache = Memcache(self.rec_cache)
|
||||
self.query_cache = Memcache(self.query_caches)
|
||||
|
||||
# set default time zone if one is not set
|
||||
self.tz = pytz.timezone(global_conf.get('timezone'))
|
||||
|
||||
@@ -9,7 +9,7 @@ from r2.lib.utils import fetch_things2, worker
|
||||
from datetime import datetime
|
||||
|
||||
from pylons import g
|
||||
query_cache = g.query_cache
|
||||
query_cache = g.permacache
|
||||
|
||||
precompute_limit = 1000
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ def send_queued_mail():
|
||||
email.to_MIMEText().as_string())
|
||||
email.set_sent(rejected = False)
|
||||
# exception happens only for local recipient that doesn't exist
|
||||
except smtplib.SMTPRecipientsRefused:
|
||||
except (smtplib.SMTPRecipientsRefused, smtplib.SMTPSenderRefused):
|
||||
# handle error and print, but don't stall the rest of the queue
|
||||
print "Handled error sending mail (traceback to follow)"
|
||||
traceback.print_exc(file = sys.stdout)
|
||||
|
||||
@@ -80,9 +80,9 @@ class Vote(MultiRelation('vote',
|
||||
|
||||
#these still need to be recalculated
|
||||
old_valid_thing = v.valid_thing
|
||||
v.valid_thing = (v.valid_thing
|
||||
and (not spam)
|
||||
and valid_thing(v, karma))
|
||||
v.valid_thing = (valid_thing(v, karma)
|
||||
and v.valid_thing
|
||||
and not spam)
|
||||
v.valid_user = (v.valid_user
|
||||
and v.valid_thing
|
||||
and valid_user(v, sr, karma))
|
||||
@@ -93,8 +93,8 @@ class Vote(MultiRelation('vote',
|
||||
v = rel(sub, obj, str(amount))
|
||||
v.author_id = obj.author_id
|
||||
v.ip = ip
|
||||
old_valid_thing = v.valid_thing = ((not spam)
|
||||
and valid_thing(v, karma))
|
||||
old_valid_thing = v.valid_thing = (valid_thing(v, karma) and
|
||||
not spam)
|
||||
v.valid_user = (v.valid_thing and valid_user(v, sr, karma)
|
||||
and not is_self_link)
|
||||
if organic:
|
||||
|
||||
Reference in New Issue
Block a user