more logging
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user