Whenever I redeploy my specific function, the event list I previously set up for it always gets deleted. Is this a bug, or is it intended to delete all the setup?
You should put the event list on your appwrite.json
to avoid that
For example, I will copy here one of my functions:
{
"$id": "conteo_registros",
"name": "CONTEO_REGISTROS",
"runtime": "python-3.9",
"path": "functions/CONTEO_REGISTROS",
"entrypoint": "src/index.py",
"ignore": [
"__pypackages__"
],
"execute": [],
"events": [
"databases.*.collections.*.documents.*.create",
"databases.*.collections.*.documents.*.delete"
],
"schedule": "",
"timeout": 15,
"variables": {
"ENDPOINT_API": "xxx",
"PROJECT_ID": "xxx",
"DB_ID": "xxx",
"COLLECTION_MD_ID": "xxx",
"API_KEY": "xxx"
}
I hope it helps you
ohh Thank you sir
Also remember whenever you deploy a new function, you should deploy it twice.
this way env
will be updated (idk why that happens).
You are always welcome
[Solved] Set the events in function
Recommended threads
- Project in AppWrite Cloud doesn't allow ...
I have a collection where the data can't be opened. When I check the functions, there are three instances of a function still running that can't be deleted. The...
- Get team fail in appwrite function
I try to get team of a user inside appwrite function, but i get this error: `AppwriteException: User (role: guests) missing scope (teams.read)` If i try on cl...
- Function in Node.JS to monitor events ar...
Hello everyone. I'm creating my first Node.JS function, but I don't have much experience with node and javascript. I'm trying to create a function, that monito...