feat: Add request logging and traffic metrics for API performance monitoring
This commit is contained in:
@@ -4,6 +4,7 @@ import { createHash } from "node:crypto";
|
||||
import { parseWeeksDocx, parseBellsDocx } from "./calendar.js";
|
||||
import { apiError, sourceError } from "./errors.js";
|
||||
import { DATA } from "./paths.js";
|
||||
import { sourceFailed } from "./metrics.js";
|
||||
import {
|
||||
academicStartYear,
|
||||
assignSemesters,
|
||||
@@ -78,6 +79,7 @@ export async function request(path, method = "GET") {
|
||||
}
|
||||
return Buffer.concat(chunks);
|
||||
} catch (error) {
|
||||
sourceFailed();
|
||||
throw sourceError(error);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user