Back
Why When i use loop in my cloud function it gives me error?
- 0
- Self Hosted
- Functions
- Databases
- Web
Rovar2000
TypeScript
import { Client, Databases, Query } from 'node-appwrite';
export default async ({ req, res, log, error }) => {
const client = new Client()
.setEndpoint(process.env.VITE_APPWRITE_ENDPOINT)
.setProject(process.env.VITE_APPWRITE_PROJECT)
.setKey(process.env.VITE_APPWRITE_API_KEY);
const databases = new Databases(client);
try {
console.log("UpdateShiftsOrders");
const {documents,total} = await databases.listDocuments(
process.env.VITE_APPWRITE_DATABASE_ID_EKHLAS,
process.env.VITE_APPWRITE_COLLECTION_ORDERS_ID,
[
Query.equal('status', 'DONE'),
]
);
console.log("Documents",orders);
documents.forEach(order => {
console.log("Order",order);
});
return res.send("Done");
} catch (e) {
console.log("Error",e);
return res.send(e);
}
};
this is my cloud function code but when i loop it this happens
TypeScript
An internal curl error has occurred within the executor! Error Msg: Http invalid protocol\nError Code: 500
and what causes this?
TL;DR
When developers use a loop in their cloud function, they encounter an error: "An internal curl error has occurred within the executor! Error Msg: Http invalid protocol\nError Code: 500." This error is caused by an issue in the implementation of the loop within the cloud function. The specific cause should be reviewed and corrected in the loop logic to resolve the error. Recommended threads
- Need help with createExecution function
Hi, Need some help understanding createExecution. When requesting function execution via createExecution, the function handler arguments are incorrect and rese...
- Query Appwrite
Hello, I have a question regarding Queries in Appwrite. If I have a string "YYYY-MM", how can I query the $createdAt column to match this filter?
- Different appwrite IDs are getting expos...
File_URL_FORMAT= https://cloud.appwrite.io/v1/storage/buckets/[BUCKET_ID]/files/[FILE_ID]/preview?project=[PROJECT_ID] I'm trying to access files in my web app...