
I'm making a food ordering app for businesses
What im trying to do is to create a menu a restuarant is going to have posted all troughout the week, with certain dishes owned by restaurant Here is the createMenu function and what it does is get the restaurants current menu's and just add a new one to the list but the update of the menu inside the restaurants takes an absurdly 15 seconds. There is not even much info on the database.
It cannot be network related cause the Web and the Database are in my machine
declare type Menu = { $id: string; name: string; dishes: Dish[]; };
declare type Restaurant = { $id: string; name: string; rnc: string; phoneNumber: string; logo: string; orders: Order[]; dishes: Dish[]; sucursales: Sucursal[]; clients: Business[]; menus: Menu[]; };
export const createMenu = async ({ name, dishes, restaurant, }: { name: string; dishes: string[]; restaurant: Restaurant; }) => { const startTime = performance.now(); // Start measuring
const { database } = await createAdminClient();
console.log(
createAdminClient execution time: ${performance.now() - startTime} ms
);
const menuStartTime = performance.now(); const menuResponse = await database.createDocument( DATABASE_ID!, MENU_COLLECTION_ID!, ID.unique(), { name: name, dishes: dishes, } ); console.log( "createDocument execution time: ${performance.now() - menuStartTime} ms" );
const menuId = menuResponse.$id;
const updatedMenus = restaurant.menus ? [...restaurant.menus, menuId] : [menuId];
const updateStartTime = performance.now(); await database.updateDocument( DATABASE_ID!, RESTAURANT_COLLECTION_ID!, restaurant.$id, { menus: updatedMenus, } ); console.log( "updateDocument execution time: ${performance.now() - updateStartTime} ms" );
console.log("Total execution time: ${performance.now() - startTime} ms"); return menuResponse; };

Could it be some rate limits that are set in appwrite by default?

if so, how can I disable them
Recommended threads
- Document Data is null.
I'm using flutter and I've just got everything set up, the document meta data is null but the actual query is fine. (see screenshot) The permission I have ar...
- cli 5.0.5 command for pull and push of d...
Hi i am using selfhosted appwrite 1.5.10, for migration (duplicate project) purpose i am using cli 5.0.5, but i am unable to find commands for pull and push, wh...
- Do I need Redis if using appwrite
Saw appwrite has built-in redis, but does this work for listdocuments, getdocument and other query etc? what does the appwrite redis covers under the hood?
