Skip to content

Commit ea71d05

Browse files
committed
remove methods
1 parent 0c01914 commit ea71d05

File tree

1 file changed

+0
-97
lines changed

1 file changed

+0
-97
lines changed

apps/webapp/app/v3/eventRepository.server.ts

Lines changed: 0 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -2114,103 +2114,6 @@ function findAttemptFailedAncestor(
21142114
return;
21152115
}
21162116

2117-
function isAncestorCancelled(
2118-
events: Map<string, { isCancelled: boolean; parentId: string | null }>,
2119-
spanId: string
2120-
) {
2121-
const event = events.get(spanId);
2122-
2123-
if (!event) {
2124-
return false;
2125-
}
2126-
2127-
if (event.isCancelled) {
2128-
return true;
2129-
}
2130-
2131-
if (event.parentId) {
2132-
return isAncestorCancelled(events, event.parentId);
2133-
}
2134-
2135-
return false;
2136-
}
2137-
2138-
function calculateDurationIfAncestorIsCancelled(
2139-
events: Map<
2140-
string,
2141-
{
2142-
isCancelled: boolean;
2143-
parentId: string | null;
2144-
isPartial: boolean;
2145-
startTime: bigint;
2146-
events: SpanEvents;
2147-
}
2148-
>,
2149-
spanId: string,
2150-
defaultDuration: number
2151-
) {
2152-
const event = events.get(spanId);
2153-
2154-
if (!event) {
2155-
return defaultDuration;
2156-
}
2157-
2158-
if (event.isCancelled) {
2159-
return defaultDuration;
2160-
}
2161-
2162-
if (!event.isPartial) {
2163-
return defaultDuration;
2164-
}
2165-
2166-
if (event.parentId) {
2167-
const cancelledAncestor = findFirstCancelledAncestor(events, event.parentId);
2168-
2169-
if (cancelledAncestor) {
2170-
// We need to get the cancellation time from the cancellation span event
2171-
const cancellationEvent = cancelledAncestor.events.find(
2172-
(event) => event.name === "cancellation"
2173-
);
2174-
2175-
if (cancellationEvent) {
2176-
return calculateDurationFromStart(event.startTime, cancellationEvent.time);
2177-
}
2178-
}
2179-
}
2180-
2181-
return defaultDuration;
2182-
}
2183-
2184-
function findFirstCancelledAncestor(
2185-
events: Map<
2186-
string,
2187-
{
2188-
isCancelled: boolean;
2189-
parentId: string | null;
2190-
isPartial: boolean;
2191-
startTime: bigint;
2192-
events: SpanEvents;
2193-
}
2194-
>,
2195-
spanId: string
2196-
) {
2197-
const event = events.get(spanId);
2198-
2199-
if (!event) {
2200-
return;
2201-
}
2202-
2203-
if (event.isCancelled) {
2204-
return event;
2205-
}
2206-
2207-
if (event.parentId) {
2208-
return findFirstCancelledAncestor(events, event.parentId);
2209-
}
2210-
2211-
return;
2212-
}
2213-
22142117
function sanitizedAttributes(json: Prisma.JsonValue) {
22152118
if (json === null || json === undefined) {
22162119
return;

0 commit comments

Comments
 (0)