Commit Graph

2119 Commits

Author SHA1 Message Date
Max Goodman
6d8f87f044 Add missing @wraps to cross_domain. 2012-11-15 14:24:11 -08:00
Max Goodman
0b9e433101 apidoc: Replace wraps_api with functools.wraps.
Since functools.wraps updates based on the source fn.__dict__, it looks
like this was a wasteful nop. :/
2012-11-15 14:24:11 -08:00
Roger Ostrander
1340e0c0ef The 'share' link can now share with reddit users via PM.
From /r/ideasfortheadmins http://redd.it/z5d0y
2012-11-15 14:20:08 -08:00
Keith Mitchell
2efdb437fa promote.py: Clearer timer names
Also, replace Timer with log message for infrequently hit
code path.
2012-11-15 14:02:52 -08:00
Keith Mitchell
f2d815ef25 promote.py: Use namedtuple for storing weights
This replaces the difficult-to-follow tuples with
a namedtuple, AdWeight, that should be slightly less
difficult to understand when reading.
2012-11-15 14:02:46 -08:00
Keith Mitchell
a481dc33b3 promote.py: Whitespace cleanup 2012-11-15 14:02:40 -08:00
Keith Mitchell
9583c04604 promote.py: Clean up imports 2012-11-15 14:02:35 -08:00
Keith Mitchell
e0f8706d46 promote.py: Redundant param in set_live_promotions
set_live_promotions had a redundant "links" parameter
(an item that can be calculated from its other param).

This removes that from the function call, as well
as from the return value of its partner, get_live_promotions
2012-11-15 14:02:22 -08:00
Keith Mitchell
91ae50a394 promote.py: No more permacache for get/set_live_promotions 2012-11-15 14:02:17 -08:00
Keith Mitchell
b1a3c00568 Tighten permissions checking on modmail responses
Prevents users who don't have permission to see a mail
thread from submitting replies to it.
2012-11-15 14:02:02 -08:00
Neil Williams
6d6c8335a0 app_globals: Clean up imports. 2012-11-15 13:18:09 -08:00
Neil Williams
929c6bdcd3 Drastically reorganize app_globals and time app startup.
This should give us more information on which steps of app startup are
taking the most time so that we can minimize the effects of pushes on
capacity.
2012-11-15 13:18:09 -08:00
Neil Williams
c8a725758c Add "days" config type and move MODWINDOW into it. 2012-11-15 13:18:09 -08:00
Neil Williams
64378cf031 stats.Timer: Add method for getting timer's elapsed time. 2012-11-15 13:18:09 -08:00
shlurbee
0e54ffbe23 Function to fetch refund amount from authorize.net 2012-11-13 14:03:47 -08:00
Neil Williams
b8b7786efc app_globals: Move queue declarations to setup() etc.
It now relies on ini file configuration.
2012-11-12 16:03:06 -08:00
Neil Williams
e412fdcde7 Shard vote_link_qs by last digit of subreddit ID.
This should help with permacache contention.
2012-11-12 16:02:59 -08:00
Neil Williams
9faa009082 gilding: Add some views for stats gathering. 2012-11-12 16:02:29 -08:00
Brian Simpson
ed44ccf213 tdb_cassandra: Resurrect View.get_time_sorted_columns. 2012-11-12 16:02:23 -08:00
Keith Mitchell
0aaf9b9307 Correct duplicate PromotionLog from mis-merge 2012-11-12 15:49:52 -08:00
Keith Mitchell
141f3d3b0a Search upload: Fix bug in NSFW status of subreddits 2012-11-12 15:49:52 -08:00
Keith Mitchell
9ae5aaa82a Serve ad data from LiveAdWeights, not permacache 2012-11-12 15:49:52 -08:00
Keith Mitchell
a0eef4ca5d Organize imports in bidding.py 2012-11-12 15:49:52 -08:00
Keith Mitchell
940b54fc84 LiveAdWeights: Cache friendly, non-permacache ads 2012-11-12 15:49:51 -08:00
Keith Mitchell
1ef424958e SponsorBoxWeightings: optimize set_from_weights
It now will do a smart lookup of what Subreddits might be
active, and update only that set.
2012-11-12 15:49:40 -08:00
Keith Mitchell
df7df27aab bidding: Refactor PromotionWeights queries 2012-11-12 15:49:40 -08:00
Keith Mitchell
7e9f9fb488 Fix issues with use of amqp for SponsorBoxWeights 2012-11-12 15:49:12 -08:00
bsimpson63
3602982f34 Useful keep_fn for unmoderated. 2012-11-12 13:20:22 -05:00
Max Goodman
0185a1fbb4 Scale gold message preview width to fit containing box.
This prevents the inline-block behavior of displaying on the
same line as the buy buttons if the preview is very thin.
2012-11-09 11:22:50 -08:00
Max Goodman
789a6ee5b6 Show comment gilding in compact. 2012-11-09 11:22:50 -08:00
Max Goodman
d17d4c0e0e Add page body classes to compact. 2012-11-09 11:22:50 -08:00
Max Goodman
921da7e9f6 Generalize thing row class code for use in compact template. 2012-11-09 11:22:50 -08:00
Max Goodman
efb0fd670b Add gilded property to comment .json output. 2012-11-09 11:22:50 -08:00
Max Goodman
1eea551955 Fix up spacing between gold form <p>s. 2012-11-09 11:22:50 -08:00
Max Goodman
25e7a5ffda Dim gildings during the first hour of a post. 2012-11-09 11:22:49 -08:00
bsimpson63
04e3226128 Make special_reddits use SRMember lookup rather than special query. 2012-11-09 11:22:49 -08:00
Neil Williams
27f99dc881 gilding: Don't bother showing gilding icon on deleted/removed comments. 2012-11-09 11:22:49 -08:00
shlurbee
6a40f4e5bc Available impressions viz on campaign edit page
Adds callback to the subreddit selector on the promo edit page that updates
an available inventory graph when the selected target changes. Shows available
front page inventory if no target is selected.

Right now this is set up in a new route. Eventually it should replace the old
promoted/edit_promo route.

TODO: change color of graph to show when inventory is running low
TODO: i18n of javascript strings
2012-11-08 18:17:35 -08:00
shlurbee
9519af54ab Promo admin tool
Lets admins and sponsors view ads that were scheduled to run on a certain
day or that were scheduled to launch a certain day. Useful for doing damage
control when there are site problems.
2012-11-08 18:17:31 -08:00
shlurbee
28dda9d599 Ungate campaign traffic page
This will allow us to get feedback from users. It's still not linked
publicly anywhere.
2012-11-08 18:17:26 -08:00
shlurbee
009a0659aa Move to_date() function from bidding to utils 2012-11-08 18:16:47 -08:00
Max Goodman
51019acb67 Dim gildings on posts younger than 6 hours. 2012-11-08 16:16:30 -08:00
Max Goodman
2210e33123 Add a body class containing the rough age of the page link. 2012-11-08 16:16:30 -08:00
Max Goodman
e44960f780 Add a close button to the comment gilding box. 2012-11-08 16:16:30 -08:00
Max Goodman
3423cdc19c Add back gold gift message markdown wrapping.
This enables comment/selfpost styling of the markup in this field.
2012-11-08 16:16:30 -08:00
Neil Williams
13497f6f08 queries: Move /r/all/comments to new query cache (try 3).
The first time we tried to move /r/all/comments to the new query cache,
the row quickly grew to be massive because tombstones were piling up in
the row cache. The row started taking seconds to retrieve after only 12
hours.

We reverted.

We took gc_grace_seconds down to 30 minutes which is relatively safe in
the query cache (prunes can be re-executed without issue and lost
deletes of non-pruned things will be covered by keep_fns).
Additionally, we switched to the leveled compaction strategy for the
relevant column families.

Then we tried this again. This time, things ran fine for three days
before we started seeing out-of-memory issues on the nodes responsible
for this key.  The row size was rather large again.

We reverted.

Now, we're trying again with three more changes, working on the
hypothesis that runaway growth of a hot query can happen because prunes
start failing after a small bad spike.

* tdb_cassandra.max_column_count has been drastically reduced in favor
  of xget for the models that actually need to fetch hugely wide rows.
  This saves memory pressure via materialized thrift buffers in general
  and when the row grows large for whatever reason.

* The pruning behaviour has been tweaked to only prune a portion of the
  extraneous columns if there are a large number.  This should reduce
  the likelihood that prunes will fail after a row has grown too much.

* This query is now in its own column family that is designed to have
  its rowcache disabled.

Why bother shoehorning this query into this data model, you say? It's a
canary for extreme scaling of other queries.  If we can't fix this
problem for this query, we should re-evaluate the whole data model.
2012-11-08 15:08:58 -08:00
Neil Williams
2d2a8d887b Remove unused last-modified check from GET_stylesheet.
We no longer write to the old last modified system for stylesheets
anyway, so there's no point in checking.  S3 handles last modified for
the staticized stylesheets anyway.
2012-11-08 15:04:25 -08:00
Neil Williams
65368b9abb Add a script to detect regressions in code quality.
This script will determine if changes from the upstream branch to the
current branch have caused any additional reports from pep8, pep257, and
pyflakes.
2012-11-08 15:04:25 -08:00
Neil Williams
e3952a5555 Add script for cleaning up the static files bucket on S3. 2012-11-08 15:04:25 -08:00
Max Goodman
440cb664ac Move gold prices to configuration parameters. 2012-11-08 10:12:51 -08:00