-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
36 changed files
with
762 additions
and
648 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package ftl.args | ||
|
||
typealias ShardChunks = List<List<String>> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package ftl.run | ||
|
||
import ftl.args.IArgs | ||
import ftl.config.FtlConstants | ||
import ftl.gc.GcTestMatrix | ||
import ftl.json.MatrixMap | ||
import ftl.run.common.getLastArgs | ||
import ftl.run.common.getLastMatrices | ||
import ftl.util.MatrixState | ||
import kotlinx.coroutines.launch | ||
import kotlinx.coroutines.runBlocking | ||
|
||
// used to cancel and update results from an async run | ||
fun cancelLastRun(args: IArgs) { | ||
val matrixMap = getLastMatrices(args) | ||
val lastArgs = getLastArgs(args) | ||
|
||
cancelMatrices(matrixMap, lastArgs) | ||
} | ||
|
||
/** Cancel all in progress matrices in parallel **/ | ||
private fun cancelMatrices(matrixMap: MatrixMap, args: IArgs) { | ||
println("CancelMatrices") | ||
|
||
val map = matrixMap.map | ||
var matrixCount = 0 | ||
|
||
runBlocking { | ||
map.forEach { matrix -> | ||
// Only cancel unfinished | ||
if (MatrixState.inProgress(matrix.value.state)) { | ||
matrixCount += 1 | ||
launch { GcTestMatrix.cancel(matrix.key, args) } | ||
} | ||
} | ||
} | ||
|
||
if (matrixCount == 0) { | ||
println(FtlConstants.indent + "No matrices to cancel") | ||
} else { | ||
println(FtlConstants.indent + "Cancelling ${matrixCount}x matrices") | ||
} | ||
|
||
println() | ||
} |
Oops, something went wrong.