Parcourir la source

Log restoreCheckpoint duration

cte il y a 11 mois
Parent
commit
94cb09f6cd
1 fichiers modifiés avec 3 ajouts et 0 suppressions
  1. 3 0
      src/services/checkpoints/CheckpointService.ts

+ 3 - 0
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
 	}