mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Add logs to event-handler function
This commit is contained in:
@@ -1515,6 +1515,9 @@ class FunctionsCustomServerTest extends Scope
|
||||
$this->assertArrayHasKey('x-appwrite-execution-delay', $requestHeaders);
|
||||
$this->assertIsNumeric($requestHeaders['x-appwrite-execution-delay']);
|
||||
$this->assertGreaterThan($requestHeaders['x-appwrite-scheduled-at'], $requestHeaders['x-appwrite-executed-at']);
|
||||
$this->assertStringContainsString('execution-delay-is-valid', $lastExecution['logs']);
|
||||
$this->assertStringContainsString('scheduled-at-is-valid', $lastExecution['logs']);
|
||||
$this->assertStringContainsString('executed-at-is-valid', $lastExecution['logs']);
|
||||
|
||||
}, 10000, 500);
|
||||
|
||||
|
||||
@@ -1,5 +1,22 @@
|
||||
module.exports = async(context) => {
|
||||
context.log(context.req.body.$id);
|
||||
context.log(context.req.body.name);
|
||||
if (context.req.headers["x-appwrite-execution-delay"]) {
|
||||
context.log("execution-delay-is-valid");
|
||||
} else {
|
||||
context.log("execution-delay-is-invalid");
|
||||
}
|
||||
|
||||
if (context.req.headers["x-appwrite-scheduled-at"]) {
|
||||
context.log("scheduled-at-is-valid");
|
||||
} else {
|
||||
context.log("scheduled-at-is-invalid");
|
||||
}
|
||||
|
||||
if (context.req.headers["x-appwrite-executed-at"]) {
|
||||
context.log("executed-at-is-valid");
|
||||
} else {
|
||||
context.log("executed-at-is-invalid");
|
||||
}
|
||||
return context.res.empty();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user