Openstatus www.openstatus.dev

feat: new temp task

mxkaske 39ca0472 abd6301b

+21 -1
+21 -1
apps/web/src/app/api/checker/cron/_cron.ts
··· 80 80 Authorization: `Basic ${env.CRON_SECRET}`, 81 81 }, 82 82 httpMethod: "POST", 83 - url: "https://checker.openstatus.dev/", 83 + url: "https://api.openstatus.dev/checkerV2", 84 84 body: Buffer.from(JSON.stringify(payload)).toString("base64"), 85 85 }, 86 86 }; ··· 88 88 const [response] = await client.createTask(request); 89 89 90 90 allResult.push(response); 91 + 92 + /** 93 + * Pushing to our Golang endpoint 94 + */ 95 + const tempTask: google.cloud.tasks.v2beta3.ITask = { 96 + httpRequest: { 97 + headers: { 98 + "Content-Type": "application/json", // Set content type to ensure compatibility your application's request parsing 99 + ...(region !== "auto" && { "fly-prefer-region": region }), // Specify the region you want the request to be sent to 100 + Authorization: `Basic ${env.CRON_SECRET}`, 101 + }, 102 + httpMethod: "POST", 103 + url: "https://checker.openstatus.dev/", 104 + body: Buffer.from(JSON.stringify(payload)).toString("base64"), 105 + }, 106 + }; 107 + const tempRequest = { parent: parent, task: tempTask }; 108 + const [tempResponse] = await client.createTask(tempRequest); 109 + 110 + allResult.push(tempResponse); 91 111 } 92 112 } 93 113 await Promise.all(allResult);