@@ -1425,6 +1425,11 @@ class TaskCoordinator {
1425
1425
keepRunAlive = json . keepRunAlive ;
1426
1426
}
1427
1427
1428
+ let async = false ;
1429
+ if ( "async" in json && typeof json . async === "boolean" ) {
1430
+ async = json . async ;
1431
+ }
1432
+
1428
1433
const { runId, now, ms } = json ;
1429
1434
1430
1435
if ( ! runId ) {
@@ -1440,6 +1445,10 @@ class TaskCoordinator {
1440
1445
1441
1446
console . log ( "Manual duration checkpoint" , data ) ;
1442
1447
1448
+ if ( async ) {
1449
+ return reply . text ( "Creating checkpoint in the background" , 202 ) ;
1450
+ }
1451
+
1443
1452
const checkpoint = await this . #checkpointer. checkpointAndPush ( {
1444
1453
runId : data . runId ,
1445
1454
projectRef : data . projectRef ,
@@ -1473,6 +1482,7 @@ class TaskCoordinator {
1473
1482
message : `keeping run ${ runId } alive after checkpoint` ,
1474
1483
checkpoint,
1475
1484
requestJson : json ,
1485
+ platformAck : ack ,
1476
1486
} ) ;
1477
1487
}
1478
1488
@@ -1484,6 +1494,7 @@ class TaskCoordinator {
1484
1494
message : `checkpoint created for run ${ runId } ` ,
1485
1495
checkpoint,
1486
1496
requestJson : json ,
1497
+ platformAck : ack ,
1487
1498
} ) ;
1488
1499
} catch ( error ) {
1489
1500
return reply . json ( {
@@ -1515,6 +1526,11 @@ class TaskCoordinator {
1515
1526
keepRunAlive = json . keepRunAlive ;
1516
1527
}
1517
1528
1529
+ let async = false ;
1530
+ if ( "async" in json && typeof json . async === "boolean" ) {
1531
+ async = json . async ;
1532
+ }
1533
+
1518
1534
const { runId } = json ;
1519
1535
1520
1536
if ( ! runId ) {
@@ -1530,6 +1546,10 @@ class TaskCoordinator {
1530
1546
1531
1547
console . log ( "Manual checkpoint" , data ) ;
1532
1548
1549
+ if ( async ) {
1550
+ return reply . text ( "Creating checkpoint in the background" , 202 ) ;
1551
+ }
1552
+
1533
1553
const checkpoint = await this . #checkpointer. checkpointAndPush ( {
1534
1554
runId : data . runId ,
1535
1555
projectRef : data . projectRef ,
@@ -1562,6 +1582,7 @@ class TaskCoordinator {
1562
1582
message : `keeping run ${ runId } alive after checkpoint` ,
1563
1583
checkpoint,
1564
1584
requestJson : json ,
1585
+ platformAck : ack ,
1565
1586
} ) ;
1566
1587
}
1567
1588
@@ -1573,6 +1594,7 @@ class TaskCoordinator {
1573
1594
message : `checkpoint created for run ${ runId } ` ,
1574
1595
checkpoint,
1575
1596
requestJson : json ,
1597
+ platformAck : ack ,
1576
1598
} ) ;
1577
1599
} catch ( error ) {
1578
1600
return reply . json ( {
0 commit comments