feat(backtests): separate saving from retry-safe run submission
This commit is contained in:
parent
5eb0985057
commit
9b9403e36b
18 changed files with 1200 additions and 226 deletions
|
|
@ -64,7 +64,8 @@ export const backtestApiV2 = {
|
|||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify(request),
|
||||
// Web saves are deliberately separate from durable run submission.
|
||||
body: JSON.stringify({ ...request, autoStart: false }),
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
|
|
@ -123,11 +124,16 @@ export const backtestApiV2 = {
|
|||
},
|
||||
|
||||
// Run operations
|
||||
async createRun(backtestId: string, request?: CreateRunRequest): Promise<Run> {
|
||||
async createRun(
|
||||
backtestId: string,
|
||||
request?: CreateRunRequest,
|
||||
submissionKey?: string
|
||||
): Promise<Run> {
|
||||
const response = await fetch(`${API_BASE_URL}/api/v2/backtests/${backtestId}/runs`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
...(submissionKey ? { 'Idempotency-Key': submissionKey } : {}),
|
||||
},
|
||||
body: JSON.stringify(request || {}),
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue