Brian Simpson
7bdc106585
SimpleRateLimit: Prefix key with "rl:" for routing by mcrouter
2016-06-14 12:30:37 -07:00
Brian Simpson
db6f9e4631
Add SimpleRateLimit class for creating simple ad hoc ratelimiters
2016-06-14 12:30:37 -07:00
Brian Simpson
84bea274f6
VRatelimitImproved: Remove call to _record_event when user is exempt
...
VRatelimitImproved._record_event doesn't exist
2016-06-14 12:30:37 -07:00
Brian Simpson
f5c601299b
app_globals: Add "sr_muted_quota" to ConfigValue.int
2016-06-14 12:30:31 -07:00
Chris Slowe
7e5f4a415d
Re-allow mods to sticky non-moderator self-posts.
2016-06-13 16:13:50 -07:00
Chris Slowe
599628a6a5
Only check stickyable on unstickied posts.
2016-06-13 16:11:50 -07:00
Chris Slowe
ba9dc13eb5
Change 'sticky' posts to 'announcements' and restrict to self-posts by mods
2016-06-13 15:29:49 -07:00
Brian Simpson
3a97cd0cac
Thing._incr: Rollback postgres transaction if cache write fails
...
This will prevent prevent repeatedly incrementing the postgres value if
the cache operation fails and the entire incr is retried.
2016-06-13 11:03:51 -07:00
Chris Slowe
29e271cc37
Add better explanation around bucketing variant truncation.
2016-06-10 08:53:16 -07:00
Chris Slowe
e448e6a2f7
Fix unit tests, and remove old ones.
2016-06-08 14:27:20 -07:00
Chris Slowe
f2da4f4716
Handle error codes on post_tests.py
2016-06-08 14:18:28 -07:00
Chris Slowe
7cb0085a65
Add new (signed) APIv1 login handler with tests.
2016-06-08 14:00:14 -07:00
Chris Slowe
77acb16055
Re-enable (and fix) login and pref tests.
...
This fix encountered two python warts: unicode handling and missing __init__.py files.
2016-06-08 11:22:55 -07:00
Jakeable
36fc55578c
Fix issue with moderator removal message
...
When a moderator removes themself, a message would still be sent ([example](https://www.reddit.com/message/messages/5n38ss )). This stops that from happening.
Perhaps a better fix would be to send a slightly different message to the subreddit if a moderator removes themself (e.g. /u/user has removed themself as a moderator of /r/subreddit).
2016-06-07 15:45:29 -07:00
birakattack
0378c0cbf1
Fix unload dialog on duplicate link submissions
...
The beforeunload event dialog warning was showing up on duplicate link
submissions. This was fixed to redirect to the original link post.
2016-06-07 14:59:04 -07:00
birakattack
901ef7c9fb
Improve usability of unload warning for bfcache
...
Preserve bfcache functionality when users abandon comments. Prevents
handler uneccessarily being loaded.
2016-06-07 14:58:46 -07:00
birakattack
0c6546d586
Fix bfcache on cancelled comments.
2016-06-07 14:58:35 -07:00
Brian Simpson
afed8a4b19
Delete unused CachedUser
2016-06-07 13:28:26 -07:00
Brian Simpson
e3653bb0d2
recommender: Don't cache SRRecommendation._byID lookup
...
C* should be able to handle these reads.
2016-06-07 13:28:26 -07:00
Brian Simpson
9ef801ce49
search._rebuild_link_index: Don't use g.cache to store progress
2016-06-07 13:28:26 -07:00
Brian Simpson
23198bbd66
Don't set value to g.cache when a user claims a gold code
2016-06-07 13:28:25 -07:00
Brian Simpson
950ff454b5
ipn: Delete g.cache flag
2016-06-07 13:28:04 -07:00
Brian Simpson
b28cc7f392
rendercache: Set TTL to 1 hour
2016-06-07 08:29:12 -07:00
Brian Simpson
d238d64036
emr_helpers.get_step_state: Sort steps by creation time
2016-06-07 08:29:06 -07:00
Lev Alexandrovich Neiman
e7ccd872fa
Add has_been_atoed to Account
2016-06-06 13:42:22 -07:00
Brian Simpson
b423fe2bf8
ModeratorInbox: Use g.thingcache
2016-06-02 16:17:35 -07:00
Brian Simpson
075d17c98f
Report: Use g.thingcache
2016-06-02 16:16:41 -07:00
Brian Simpson
ac0bc5a2f5
Inbox: Use g.thingcache
2016-06-02 16:15:28 -07:00
Brian Simpson
d37f3056c6
models.py: Cleanup imports
2016-06-02 16:15:11 -07:00
Brian Simpson
e75f288a64
Friend: Use g.thingcache
2016-06-02 14:45:07 -07:00
Brian Simpson
10af5d5f6e
Flair: Use g.thingcache
2016-06-02 14:14:44 -07:00
Brian Simpson
f16a88623b
Trophy: Use g.thingcache
2016-06-02 14:05:49 -07:00
Brian Simpson
2456495326
Award: Use g.thingcache
2016-06-02 13:29:26 -07:00
Brian Simpson
d22822aae6
mcrouter: Add prefixes for Award, Trophy, Flair, Friend, Inbox, Report, ModeratorInbox
2016-06-02 13:29:26 -07:00
Brian Simpson
9e0669fc0a
setup_mcrouter.sh: Use named_handles to reduce repetition
2016-06-02 13:29:21 -07:00
Lev Alexandrovich Neiman
e35204bc82
Mailgun: use domain from from_address
2016-06-02 10:29:20 -07:00
Brian Simpson
fcfefebd48
setup_mcrouter.sh: Use local route as wildcard fallback
...
In local dev we'll only ever have a single cache pool with all
keys routed to it. Set the wildcard fallback so that all keys are
routed even if the mcrouter config isn't fully up to date.
2016-06-02 09:21:45 -07:00
Ricky Ramirez
626cd2e7c3
cache: Reject negative TTLs.
...
pylibmc will silently convert these to unsigned integers.
2016-05-31 15:50:23 -07:00
Ricky Ramirez
0f39c70c42
ratelimit: Correct logic error in setting TTL.
2016-05-31 15:50:23 -07:00
Chris Slowe
0be4bf8d14
Send a message to moderators on their removal.
...
This creates a paper trail of sorts in the moderator mail as well on who has demodded whom.
2016-05-31 15:24:58 -07:00
Peter Wildani
b6e7303f33
Avoid selectedOptions for IE compatiblity.
2016-05-31 11:16:16 -07:00
Peter Wildani
c6d66e8b00
Add a hook for more complicated sr style validation.
2016-05-31 11:16:16 -07:00
Brian Simpson
331061ca4f
Thing: Decrease _cache_ttl to 12 hours
2016-05-31 11:07:52 -07:00
Brian Simpson
c2954a73f4
Query: Make _cache_ttl a class attribute
2016-05-31 11:07:52 -07:00
Brian Simpson
399b529482
Thing: Make _cache_ttl a class attribute
2016-05-31 11:07:52 -07:00
Brian Simpson
3dd9514448
emr traffic: remove parens from jobflow name
...
The jobflow name is set as a tag, and parens are illegal characters
in tags.
2016-05-31 11:07:47 -07:00
Peter Wildani
2e817fc90d
Convert VRatelimitImproved to use ratelimit.RateLimit
2016-05-31 10:38:09 -07:00
Peter Wildani
b0e0ed7b5b
Simplify ratelimit.py's API
...
The fundamental operations that the user of the library cares about are
"check if I can take an action" and "record that I took, or am about to
take, an action".
The standlone functions provide the tools needed to build the above
operations. They do not have any policy beyond the translation of their
use case to the underlying key-value store operations, so they are
valuable in unusual cases. The new RateLimit uses them to make the
probably-common case of ratelimits pulled from g.live_config simpler. It
provides check() and record_usage() operations.
Also, add documentation and _multi variants and support rate limits with
greater than 1 day periods, despite that they are more likely to fail
due to cache resets.
2016-05-31 10:37:55 -07:00
Brian Simpson
74f2ef66ac
Stop writing PromoCampaign objects to g.cache
2016-05-26 15:29:57 -07:00
Brian Simpson
f2a1984a38
Read PromoCampaign objects from g.thingcache
2016-05-26 15:29:52 -07:00