Skip to content

Commit

Permalink
format code
Browse files Browse the repository at this point in the history
  • Loading branch information
Panaetius authored and Ralf Grubenmann committed Jan 29, 2024
1 parent cdfafa4 commit 2986bed
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion client/src/features/session/sessions.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const sessionsApi = createApi({
({
id: sessionName,
type: "Session",
}) as const,
} as const)
),
"Session",
]
Expand Down
10 changes: 5 additions & 5 deletions server/src/websocket/handlers/sessions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ interface Session {

function handlerRequestSessionStatus(
data: Record<string, unknown>,
channel: Channel,
channel: Channel
): void {
channel.data.set("sessionStatus", null);
}
Expand All @@ -75,7 +75,7 @@ function sendMessage(data: string, channel: Channel) {
function heartbeatRequestSessionStatus(
channel: Channel,
apiClient: APIClient,
authHeathers: Record<string, string>,
authHeathers: Record<string, string>
): void {
const previousStatuses = channel.data.get("sessionStatus") as string;
apiClient
Expand All @@ -102,16 +102,16 @@ function heartbeatRequestSessionStatus(
totalNumContainers: total_num_containers ?? -1,
};
return [key, { status: cleanedStatus }] as const;
},
}
);
const cleanedServers = cleanedServerEntries.reduce(
(obj, [key, value]) => ({ ...obj, [key]: value }),
{} as Record<string, Session>,
{} as Record<string, Session>
);

const sortedObject = sortObjectProperties(cleanedServers);
const currentHashedSessions = simpleHash(
JSON.stringify(sortedObject),
JSON.stringify(sortedObject)
).toString();
// only send message when something change
if (!util.isDeepStrictEqual(previousStatuses, currentHashedSessions)) {
Expand Down

0 comments on commit 2986bed

Please sign in to comment.