Back

Rate limit for current endpoint has been exceeded. Trying to upload 850 entries.

  • 0
  • Databases
  • Web
xmaniaxz
13 Feb, 2024, 10:55

Hi, I am currently using the starter plan (free plan) and i am trying to upload my API to my Database.

No when i do this immediately get hit with the error Uncaught (in promise) AppwriteException: Rate limit for the current endpoint has been exceeded. Please try again after some time.

Now i understand ofcourse that this is to prevent Ddos attacks etc.

Now my question is: How do i upload all of my entries without setting off a bunch of flags

TypeScript
export async function AddToDataBase() {
  const SpellLevel = Object.keys(api);
  SpellLevel.forEach((Level) => {
    api[Level].map(async (spells) => {
      const spell = {
        SpellName: spells.spellName,
        School: spells.school,
        CastingTime: spells.castingTime,
        Range: spells.range,
        Duration: spells.duration,
        Components: spells.components,
        Description: spells.description,
        HigherLevel: spells.higherLevel,
        Class: spells.spelllists,
        SpellLevel: Level,
      };
      const Doc = await database.createDocument(
        process.env.NEXT_PUBLIC_DATABASE_ID,
        process.env.NEXT_PUBLIC_COLLECTION_SPELL_ID,
        ID.unique(),
        spell
      );
    });
  });
}
TL;DR
The developer is experiencing a rate limit error while trying to upload their API to their database. They are using the free plan and want to know how to upload all the entries without triggering the rate limit. The error message they receive is "Rate limit for the current endpoint has been exceeded. Please try again after some time." Solution: The developer can try implementing a delay between each API upload to avoid triggering the rate limit. They can use the setTimeout function to introduce a delay before making each API call.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more