Skip to content
Source
Sign inSign up
pingdotgg/t3code

perf(server): turns no longer re-snapshot repositories they left alone #48231

Openjuliusmarmingewants to merge 2 commits intomain fromrefs/pull/48231/headopened View on GitHub

Showing 7 changed files with 100 additions and 2 deletions (loading 4).

x
0 of 7 viewed, 7 left
9 additions and 0 deletionsapps/server/src/checkpointing/CheckpointStore.tsModified
View file
@@ -95,6 +95,8 @@
​
readonly copyCheckpointRef: VcsCheckpointOps["copyCheckpointRef"];
​
+ readonly copyCheckpointRefIfUnchanged: VcsCheckpointOps["copyCheckpointRefIfUnchanged"];
+​
readonly restoreCheckpoint: (
input: RestoreCheckpointInput,
) => Effect.Effect<boolean, CheckpointStoreError>;
@@ -169,6 +171,12 @@
return yield* checkpoints.copyCheckpointRef(input);
});
​
+ const copyCheckpointRefIfUnchanged: CheckpointStore["Service"]["copyCheckpointRefIfUnchanged"] =
+ Effect.fn("CheckpointStore.copyCheckpointRefIfUnchanged")(function* (input) {
+ const checkpoints = yield* resolveCheckpoints(input.cwd);
+ return yield* checkpoints.copyCheckpointRefIfUnchanged(input);
+ });
+​
const restoreCheckpoint: CheckpointStore["Service"]["restoreCheckpoint"] = Effect.fn(
"restoreCheckpoint",
)(function* (input) {
@@ -204,6 +212,7 @@
captureHeadCheckpoint,
hasCheckpointRef,
copyCheckpointRef,
+ copyCheckpointRefIfUnchanged,
restoreCheckpoint,