From 94cb09f6cd94b2215f9c88994a871f350c11e6f4 Mon Sep 17 00:00:00 2001 From: cte Date: Tue, 11 Feb 2025 11:24:33 -0800 Subject: [PATCH] Log restoreCheckpoint duration --- src/services/checkpoints/CheckpointService.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/services/checkpoints/CheckpointService.ts b/src/services/checkpoints/CheckpointService.ts index 15b9cb415b..d229452021 100644 --- a/src/services/checkpoints/CheckpointService.ts +++ b/src/services/checkpoints/CheckpointService.ts @@ -354,9 +354,12 @@ export class CheckpointService { } public async restoreCheckpoint(commitHash: string) { + const startTime = Date.now() await this.ensureBranch(this.mainBranch) await this.git.clean([CleanOptions.FORCE, CleanOptions.RECURSIVE]) await this.git.raw(["restore", "--source", commitHash, "--worktree", "--", "."]) + const duration = Date.now() - startTime + this.log(`[restoreCheckpoint] restored checkpoint ${commitHash} in ${duration}ms`) this.currentCheckpoint = commitHash }