MCPcopy
hub / github.com/triggerdotdev/trigger.dev / restore

Method restore

apps/docker-provider/src/index.ts:167–194  ·  view source on GitHub ↗
(opts: TaskOperationsRestoreOptions)

Source from the content-addressed store, hash-verified

165 }
166
167 async restore(opts: TaskOperationsRestoreOptions) {
168 await this.#initialize();
169
170 const containerName = this.#getRunContainerName(opts.runId);
171
172 if (!this.#canCheckpoint || this.opts.forceSimulate) {
173 logger.log("Simulating restore");
174
175 const unpause = logger.debug(await $`docker unpause ${containerName}`);
176
177 if (unpause.exitCode !== 0) {
178 throw new Error("docker unpause command failed");
179 }
180
181 await this.#sendPostStart(containerName);
182 return;
183 }
184
185 const { exitCode } = logger.debug(
186 await $`docker start --checkpoint=${opts.checkpointRef} ${containerName}`
187 );
188
189 if (exitCode !== 0) {
190 throw new Error("docker start command failed");
191 }
192
193 await this.#sendPostStart(containerName);
194 }
195
196 async delete(opts: { runId: string }) {
197 await this.#initialize();

Callers 6

remix.test.tsFile · 0.45
astro.test.tsFile · 0.45
nextjs.test.tsFile · 0.45
express.test.tsFile · 0.45
#createPlatformSocketMethod · 0.45

Calls 5

#initializeMethod · 0.95
#getRunContainerNameMethod · 0.95
#sendPostStartMethod · 0.95
logMethod · 0.65
debugMethod · 0.65

Tested by

no test coverage detected