more logging

This commit is contained in:
martin-mfg
2025-10-09 11:23:16 +02:00
parent c592929984
commit c690d8ec49
2 changed files with 13 additions and 8 deletions
+12 -7
View File
@@ -141,14 +141,19 @@ export default async (_, res) => {
res.setHeader("Content-Type", "application/json");
try {
// Add header to prevent abuse.
const PATsInfo = await getPATInfo(uptimeFetcher, {});
if (PATsInfo) {
res.setHeader(
"Cache-Control",
`max-age=0, s-maxage=${RATE_LIMIT_SECONDS}`,
);
try {
const PATsInfo = await getPATInfo(uptimeFetcher, {});
if (PATsInfo) {
res.setHeader(
"Cache-Control",
`max-age=0, s-maxage=${RATE_LIMIT_SECONDS}`,
);
}
res.send(JSON.stringify(PATsInfo, null, 2));
console.log("pat-info done");
} catch (e) {
console.log("pat-info exception:", e);
}
res.send(JSON.stringify(PATsInfo, null, 2));
} catch (err) {
// Throw error if something went wrong.
logger.error(err);
+1 -1
View File
@@ -248,7 +248,7 @@ const buildSearchFilter = (repos = [], owners = []) => {
* @returns {Promise<any>} Request response.
*/
const request = (data, headers) => {
console.log("making request with: " + headers + " | " + data);
console.log("making request with: " + JSON.stringify(headers) + " | " + JSON.stringify(data));
try {
let response = axios({
url: "https://api.github.com/graphql",