Add duration logging

This commit is contained in:
cte 2025-02-11 10:16:51 -08:00
parent 68ea2e8588
commit 6b351876e7

View file

@ -188,6 +188,8 @@ export class CheckpointService {
}
public async saveCheckpoint(message: string) {
const startTime = Date.now()
await this.ensureBranch(this.mainBranch)
const stashSha = (await this.git.raw(["stash", "create"])).trim()
@ -334,7 +336,11 @@ export class CheckpointService {
await this.restoreMain({ branch: stashBranch, stashSha })
await this.git.branch(["-D", stashBranch])
this.log(`[saveCheckpoint] saved checkpoint ${commit}`)
// We've gotten reports that checkpoints can be slow in some cases, so
// we'll log the duration of the checkpoint save.
const duration = Date.now() - startTime
this.log(`[saveCheckpoint] saved checkpoint ${commit} in ${duration}ms`)
return { commit }
}