Skip to content

Commit 964d0a9

Browse files
committed
fix: allow logs
1 parent 1b99e31 commit 964d0a9

File tree

2 files changed

+32
-29
lines changed

2 files changed

+32
-29
lines changed

worker.js

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -26,35 +26,35 @@ export default {
2626
}
2727
},
2828

29-
async fetch(request, env, ctx) {
30-
// Test endpoint
31-
if (request.url.includes('/test')) {
32-
try {
33-
const WEBHOOK_URL = env.CIRCLECI_WEBHOOK_URL;
34-
const response = await fetch(WEBHOOK_URL, {
35-
method: 'POST',
36-
headers: {
37-
'Content-Type': 'application/json',
38-
},
39-
});
29+
// async fetch(request, env, ctx) {
30+
// // Test endpoint
31+
// if (request.url.includes('/test')) {
32+
// try {
33+
// const WEBHOOK_URL = env.CIRCLECI_WEBHOOK_URL;
34+
// const response = await fetch(WEBHOOK_URL, {
35+
// method: 'POST',
36+
// headers: {
37+
// 'Content-Type': 'application/json',
38+
// },
39+
// });
4040

41-
const responseText = await response.text();
41+
// const responseText = await response.text();
4242

43-
return new Response(`Test request completed. Status: ${response.status}\nResponse: ${responseText}`, {
44-
status: 200,
45-
headers: { 'Content-Type': 'text/plain' }
46-
});
47-
} catch (error) {
48-
return new Response(`Test failed: ${error.message}`, {
49-
status: 500,
50-
headers: { 'Content-Type': 'text/plain' }
51-
});
52-
}
53-
}
43+
// return new Response(`Test request completed. Status: ${response.status}\nResponse: ${responseText}`, {
44+
// status: 200,
45+
// headers: { 'Content-Type': 'text/plain' }
46+
// });
47+
// } catch (error) {
48+
// return new Response(`Test failed: ${error.message}`, {
49+
// status: 500,
50+
// headers: { 'Content-Type': 'text/plain' }
51+
// });
52+
// }
53+
// }
5454

55-
return new Response('CircleCI Scheduler Worker is running', {
56-
status: 200,
57-
headers: { 'Content-Type': 'text/plain' }
58-
});
59-
}
55+
// return new Response('CircleCI Scheduler Worker is running', {
56+
// status: 200,
57+
// headers: { 'Content-Type': 'text/plain' }
58+
// });
59+
// }
6060
};

wrangler.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,7 @@ main = "worker.js"
33
compatibility_date = "2024-01-15"
44

55
[triggers]
6-
crons = ["0 2 * * *"] # UTC 2:00 = (Beijing) UTC+8 10:00
6+
crons = ["0 2 * * *"] # UTC 2:00 = (Beijing) UTC+8 10:00
7+
8+
[observability.logs]
9+
enabled = true

0 commit comments

Comments
 (0)