Skip to content

Commit 0d3f138

Browse files
committed
Add inferTypes, remove default port
1 parent 7978b51 commit 0d3f138

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

jacodb-ets/src/main/kotlin/org/jacodb/ets/grpc/LoadScene.kt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,19 @@ import model.Scene as ProtoScene
2828

2929
private val logger = KotlinLogging.logger {}
3030

31-
const val DEFAULT_PORT = 50051
32-
3331
fun loadScene(
32+
port: Int,
3433
path: Path,
35-
port: Int = DEFAULT_PORT,
34+
inferTypes: Boolean = false,
3635
): ProtoScene {
3736
logger.info { "Connecting to gRPC server on port $port..." }
3837
val manager = createGrpcClient<ManagerClient>(port)
3938
logger.info { "Requesting Scene for '$path'..." }
4039
val (scene, timeLoad) = measureTimedValue {
41-
val request = GetSceneRequest(path.pathString)
40+
val request = GetSceneRequest(
41+
path = path.pathString,
42+
infer_types = inferTypes,
43+
)
4244
manager.GetScene().executeBlocking(request)
4345
}
4446
logger.info {

jacodb-ets/src/test/kotlin/org/jacodb/ets/test/GrpcTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class GrpcTest {
6767
}
6868

6969
fun getScene(path: Path): EtsScene {
70-
val scene = loadScene(path, PORT)
70+
val scene = loadScene(PORT, path)
7171
logger.info { "Converting Scene from ProtoBuf to ETS..." }
7272
val (etsScene, timeConvert) = measureTimedValue {
7373
scene.toEts()

0 commit comments

Comments
 (0)