* ci: pull version from package.json on build

* fix: implicit any type

* feat: inital support for logger

* style: fix lint

* feat: move more logging over to pino

* fix: logging around company importing
This commit is contained in:
Husky
2025-07-08 22:01:23 -04:00
committed by GitHub
parent e4fbc7cd50
commit 2b70cea4e0
33 changed files with 481 additions and 171 deletions

View File

@@ -1,5 +1,6 @@
import type { TaskMessage } from "~/server/internal/tasks";
import { WebSocketHandler } from "./ws";
import { logger } from "~/server/internal/logging";
const websocketHandler = new WebSocketHandler("/api/v1/task");
// const taskStates: { [key: string]: } = {};
@@ -38,7 +39,7 @@ websocketHandler.listen((message) => {
case "disconnect": {
const disconnectTaskId = data[0];
taskStates.delete(disconnectTaskId);
console.log(`disconnected from ${disconnectTaskId}`);
logger.info(`disconnected from ${disconnectTaskId}`);
break;
}
case "error": {
@@ -71,7 +72,7 @@ export const useTask = (taskId: string): Ref<TaskMessage | undefined> => {
if (task && task.value && !task.value.error) return task;
taskStates.set(taskId, ref(undefined));
console.log("connecting to " + taskId);
logger.info("connecting to " + taskId);
websocketHandler.send(`connect/${taskId}`);
// TODO: this may have changed behavior
return taskStates.get(taskId) ?? ref(undefined);