forked from mirrored/github-stats-extended
debug: logging in repeat-recent
This commit is contained in:
1 parent
dea0dca4e4
commit
3dafe0d9df
1 file changed
+9
@@ -6,11 +6,20 @@ export default async (req, res) => {
|
||||
res.send({ error: "Method Not Allowed" });
|
||||
return;
|
||||
}
|
||||
|
||||
console.log("Repeating recent requests...");
|
||||
|
||||
try {
|
||||
await repeatRecentRequests();
|
||||
res.statusCode = 200;
|
||||
res.send({ message: "Recent requests repeated successfully." });
|
||||
} catch (error) {
|
||||
console.error(
|
||||
"Error repeating recent requests:",
|
||||
error,
|
||||
JSON.stringify(error),
|
||||
);
|
||||
|
||||
res.statusCode = 500;
|
||||
res.send({ error: error.message || "Internal Server Error" });
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user