Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Window size config #1975

Merged
merged 19 commits into from
Sep 23, 2024
Merged

Window size config #1975

merged 19 commits into from
Sep 23, 2024

Conversation

Watchful1
Copy link
Contributor

Super bare bones initial implementation of passing a config value for window size into prawcore. Just wanted to have something down so I can feel like I started on it.

Copy link
Member

@LilSpazJoekp LilSpazJoekp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor changes.

handler.setLevel(logging.DEBUG)
stream_handler = logging.StreamHandler()
stream_handler.setLevel(logging.DEBUG)
file_handler = logging.handlers.RotatingFileHandler(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be too advanced. Maybe add a second example explaining why you recommend a rotating file handler.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed

Data: None
Params: {'raw_json': 1}
Response: 200 (876 bytes)
Response: 200 (876 bytes) (rst-45:rem-892:used-104 ratelimit) at 1691743156.3847592
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this is from prawcore but what do you think about changing the epoch to a timestamp? It would only be 1 or 2 more characters and would be human readable.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did this to match the timestamp in the first line. But no real opinion whether they should both be timestamps or a human readable date.

@@ -72,6 +72,7 @@ order to successfully access a third-party Reddit site:
(default: ``t3_``).
:subreddit_kind: The type prefix for subreddits on the :class:`.Reddit` instance
(default: ``t5_``).
:window_size: The number of seconds between rate limit resets (default: 600).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be in a different section. This section is for configuring PRAW with a custom Reddit instance.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved

@LilSpazJoekp
Copy link
Member

LilSpazJoekp commented Oct 1, 2023

prawcore has been updated. Could you rebase and squash so the pipeline can run again?

Copy link

github-actions bot commented Nov 8, 2023

This PR is stale because it has been open for 30 days with no activity.

Remove the Stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the Stale Issue or pull request has been inactive for 20 days label Nov 8, 2023
@Watchful1
Copy link
Contributor Author

Still planning on finishing this, just haven't had time recently.

@github-actions github-actions bot removed the Stale Issue or pull request has been inactive for 20 days label Nov 8, 2023
Copy link

github-actions bot commented Dec 8, 2023

This PR is stale because it has been open for 30 days with no activity.

Remove the Stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the Stale Issue or pull request has been inactive for 20 days label Dec 8, 2023
@Watchful1
Copy link
Contributor Author

Bump, will have time for this over the holidays if not before.

@github-actions github-actions bot removed the Stale Issue or pull request has been inactive for 20 days label Dec 9, 2023
Copy link

github-actions bot commented Jan 8, 2024

This PR is stale because it has been open for 30 days with no activity.

Remove the Stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the Stale Issue or pull request has been inactive for 20 days label Jan 8, 2024
@Watchful1
Copy link
Contributor Author

Bump

@github-actions github-actions bot removed the Stale Issue or pull request has been inactive for 20 days label Jan 9, 2024
Copy link

github-actions bot commented Feb 8, 2024

This PR is stale because it has been open for 30 days with no activity.

Remove the Stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the Stale Issue or pull request has been inactive for 20 days label Feb 8, 2024
@LilSpazJoekp LilSpazJoekp added Discussion Open for discussion Reddit API Change Related to a change with Reddit's API and removed Stale Issue or pull request has been inactive for 20 days labels Mar 4, 2024
@LilSpazJoekp
Copy link
Member

Just checking in on this.

@Watchful1
Copy link
Contributor Author

It's still on my list, but pretty far at the bottom below other priorities. How much do you think it's actually needed? Reddit doesn't look like they are making any changes to the window size anytime soon.

@LilSpazJoekp
Copy link
Member

Was waiting on doing a 8.0.0 release for this.

Would different paid tiers of rate limits make a difference in the rate limit calculation for optimal handling?

@Watchful1
Copy link
Contributor Author

Extremely unlikely they would have different window sizes. They just increase the requests per window. I imagine a lot of their infrastructure is built with the 10 minute window in mind.

@Watchful1
Copy link
Contributor Author

Addressed comments and got the build passing. I haven't touched this in a year, so I don't really remember my original thought process and whether I was still going to do anything else.

Let me know if there's any more changes you want, but no promises how fast I'll get to them.

@LilSpazJoekp LilSpazJoekp merged commit 83c2a8d into praw-dev:master Sep 23, 2024
14 checks passed
@LilSpazJoekp
Copy link
Member

Woot and yeah same here it can be changed if needed later on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Discussion Open for discussion Reddit API Change Related to a change with Reddit's API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants