update webhook keepalive
This commit is contained in:
@ -18,13 +18,12 @@ export async function sendWebhook<T extends WebhookAction>(action: T, data: Webh
|
|||||||
while (true) {
|
while (true) {
|
||||||
try {
|
try {
|
||||||
const response = await fetch(WEBHOOK_ENDPOINT, {
|
const response = await fetch(WEBHOOK_ENDPOINT, {
|
||||||
body: JSON.stringify(data),
|
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'x-webhook-action': action
|
'x-webhook-action': action
|
||||||
},
|
},
|
||||||
keepalive: false
|
body: JSON.stringify(data),
|
||||||
});
|
});
|
||||||
|
|
||||||
if (response.status === 200) return;
|
if (response.status === 200) return;
|
||||||
|
Reference in New Issue
Block a user