mirror of
https://github.com/maciejpedzich/six-degs-of-f1.git
synced 2024-11-09 16:33:03 +01:00
Log shortest path queries
This commit is contained in:
parent
98711d228b
commit
3aa6a9d3f8
@ -22,8 +22,14 @@ let graphProps: Awaited<ReturnType<typeof getShortestPaths>> = {
|
||||
try {
|
||||
driverNames = await getDriverNames();
|
||||
|
||||
if (noEmptyParams && paramsNotEqual)
|
||||
if (noEmptyParams && paramsNotEqual) {
|
||||
const timestamp = new Date().toLocaleString('pl');
|
||||
const clientIp =
|
||||
Astro.request.headers.get('X-Forwarded-For') || Astro.clientAddress;
|
||||
|
||||
console.log(`[${timestamp}] ${clientIp} FROM ${source} TO ${dest}`);
|
||||
graphProps = await getShortestPaths(source, dest);
|
||||
}
|
||||
} catch (error) {
|
||||
return Astro.redirect('/error');
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user