Skip to content

Commit

Permalink
fix compule
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoloboschi committed Oct 25, 2023
1 parent c3b7467 commit cf84e78
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public void init(Map<String, Object> configuration) throws Exception {

@Override
public void start() throws Exception {
server = new PythonGrpcServer(agentContext.getCodeDirectory(), configuration, agentContext);
server = new PythonGrpcServer(agentContext.getCodeDirectory(), configuration, agentId(), agentContext);
channel = server.start();
super.start();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public void init(Map<String, Object> configuration) throws Exception {

@Override
public void start() throws Exception {
server = new PythonGrpcServer(agentContext.getCodeDirectory(), configuration, agentContext);
server = new PythonGrpcServer(agentContext.getCodeDirectory(), configuration, agentId(), agentContext);
channel = server.start();
super.start();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public void init(Map<String, Object> configuration) throws Exception {

@Override
public void start() throws Exception {
server = new PythonGrpcServer(agentContext.getCodeDirectory(), configuration, agentContext);
server = new PythonGrpcServer(agentContext.getCodeDirectory(), configuration, agentId(), agentContext);
channel = server.start();
super.start();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,14 @@ public class PythonGrpcServer {

private final Path codeDirectory;
private final Map<String, Object> configuration;
private final String agentId;
private final AgentContext agentContext;
private Process pythonProcess;

public PythonGrpcServer(Path codeDirectory, Map<String, Object> configuration, AgentContext agentContext) {
public PythonGrpcServer(Path codeDirectory, Map<String, Object> configuration, String agentId, AgentContext agentContext) {
this.codeDirectory = codeDirectory;
this.configuration = configuration;
this.agentId = agentId;
this.agentContext = agentContext;
}

Expand Down Expand Up @@ -100,7 +102,7 @@ public ManagedChannel start() throws Exception {

private AgentContextConfiguration computeAgentContextConfiguration() {
final Optional<Path> persistentStateDirectoryForAgent =
agentContext.getPersistentStateDirectoryForAgent(agentContext.getAgentId());
agentContext.getPersistentStateDirectoryForAgent(agentId);

final String persistentStateDirectory = persistentStateDirectoryForAgent.map(p -> p.toFile().getAbsolutePath()).orElse(null);
AgentContextConfiguration agentContextConfiguration = new AgentContextConfiguration(persistentStateDirectory);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[packages]
[packages]
grpcio = "*"
fastavro = "*"

Expand Down

0 comments on commit cf84e78

Please sign in to comment.