Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Make link submission more robust.

  • Loading branch information...
commit fddda124402c705f668e7410738224c0f83b3d49 1 parent 0f838bd
Neil Williams authored
Showing with 6 additions and 1 deletion.
  1. +6 −1 scripts/
7 scripts/
@@ -5,8 +5,10 @@
from r2.models import Account, Subreddit, Link
from r2.lib.db import queries
from import force_thumbnail
+from r2.lib.amqp import worker
+UPVOTE = True
def submit_link(user, subreddit, title, url, thumb_url):
account = Account._by_name(user)
subreddit = Subreddit._by_name(subreddit)
@@ -20,8 +22,11 @@ def submit_link(user, subreddit, title, url, thumb_url):
force_thumbnail(link, image_data)
# various backend processing things
- queries.queue_vote(account, link, True, ip)
+ queries.queue_vote(account, link, UPVOTE, ip)
+ # wait for the amqp worker to finish up
+ worker.join()
print link.make_permalink_slow()
Please sign in to comment.
Something went wrong with that request. Please try again.