Do I need to sleep when using praw in a long running script?

572 Views Asked by At

I'm using praw v5.0.1 and in my script I am pulling all comments from a subreddit during a certain period of time. It's a long running script (about several hours) and in between querying for posts I sleep for 2 seconds. I also sleep for two seconds in between retrieving comments.

Is this a situation where I need to sleep or am I safe in removing all instances of sleeping? (to adhere to reddit API limits)

2

There are 2 best solutions below

0
On

There's no need to sleep with PRAW as it handles the rate limiting for you.

0
On

You shouldn't use sleep, it just slows everything down. PRAW handles the rate limit perfectly.