User_10_secs_limit

האט את הקצב, אתה שולח יותר מדי בקשות.
אנא נסה שוב בעוד 5 שניות.
קוד שגיאה: user_10_secs_limit.

יצרתי ערכת נושא (theme) שמשתמשת ב-await ajax(/t/${this.args.topic.id}.json);. זה מגיע להגבלת קצב (rate-limited) עקב בקשות מרובות. כיצד אוכל להימנע מכך? שמתי לב שההגבלה מסומנת כ​הגבלה ברמת משתמש , לא הגבלה מבוססת IP.

האם אתה מאחורי מאזן עומסים כמו Cloudflare כך ש-Discourse לא ידע את כתובת ה-IP האמיתית של המשתמש?
חיפוש מהיר באמצעות grep ולא מצאתי user_10_secs_limit בקוד מלבד ב-spec. אני חושד שזה קשור ל-IP למרות השגיאה שאתה רואה.

Here - You can’t grep it :slight_smile:

error_code: "#{error_code_identifier}_10_secs_limit",

Coming from discourse/lib/request_tracker/rate_limiters/user.rb at main · discourse/discourse · GitHub

@truman is your theme component doing this for many topics? What exactly are you trying to accomplish? You should either see if you can combine the calls, for instance by tagging the topics and then retrieving them by tag in a single call, and/or you should figure out a cache mechanism.

2 לייקים

Aha! I figured I was overlooking something simple. . .

לייק 1

I want to fetch the reactions for each topic so that I can display them on the homepage. like:
image

אתה צריך לבצע סריאליזציה של זה בתוסף כדי להימנע מכל השאילתות האלה.

4 לייקים

קבל את מאגר all-the-plugins וחפש את add_to_serializer

3 לייקים

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.