Skip to content

Commit 2860663

Browse files
waleedlatif1claude
andcommitted
improvement(processing): remove dead getSnapshotByHash method
No longer called after createSnapshotWithDeduplication was refactored to use a single upsert instead of select-then-insert. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent e1981b6 commit 2860663

File tree

2 files changed

+0
-25
lines changed

2 files changed

+0
-25
lines changed

apps/sim/lib/logs/execution/snapshot/service.ts

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -82,30 +82,6 @@ export class SnapshotService implements ISnapshotService {
8282
}
8383
}
8484

85-
async getSnapshotByHash(
86-
workflowId: string,
87-
hash: string
88-
): Promise<WorkflowExecutionSnapshot | null> {
89-
const [snapshot] = await db
90-
.select()
91-
.from(workflowExecutionSnapshots)
92-
.where(
93-
and(
94-
eq(workflowExecutionSnapshots.workflowId, workflowId),
95-
eq(workflowExecutionSnapshots.stateHash, hash)
96-
)
97-
)
98-
.limit(1)
99-
100-
if (!snapshot) return null
101-
102-
return {
103-
...snapshot,
104-
stateData: snapshot.stateData as WorkflowState,
105-
createdAt: snapshot.createdAt.toISOString(),
106-
}
107-
}
108-
10985
computeStateHash(state: WorkflowState): string {
11086
const normalizedState = normalizeWorkflowState(state)
11187
const stateString = normalizedStringify(normalizedState)

apps/sim/lib/logs/types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,6 @@ export interface BatchInsertResult<T> {
337337
export interface SnapshotService {
338338
createSnapshot(workflowId: string, state: WorkflowState): Promise<WorkflowExecutionSnapshot>
339339
getSnapshot(id: string): Promise<WorkflowExecutionSnapshot | null>
340-
getSnapshotByHash(workflowId: string, hash: string): Promise<WorkflowExecutionSnapshot | null>
341340
computeStateHash(state: WorkflowState): string
342341
cleanupOrphanedSnapshots(olderThanDays: number): Promise<number>
343342
}

0 commit comments

Comments
 (0)