fix: Inject for actions and health

This commit is contained in:
J H
2024-08-07 06:19:04 -06:00
parent 7c32404b69
commit 419d4986f6
3 changed files with 44 additions and 20 deletions

View File

@@ -799,12 +799,17 @@ export class SystemForEmbassy implements System {
const actionProcedure = this.manifest.actions?.[actionId]?.implementation
if (!actionProcedure) return { message: "Action not found", value: null }
if (actionProcedure.type === "docker") {
const container = await DockerProcedureContainer.of(
effects,
this.manifest.id,
actionProcedure,
this.manifest.volumes,
)
const container =
actionProcedure.inject && this.currentRunning?.mainDockerContainer
? this.currentRunning?.mainDockerContainer
: await DockerProcedureContainer.of(
effects,
this.manifest.id,
actionProcedure,
this.manifest.volumes,
)
const shouldDestroy =
container !== this.currentRunning?.mainDockerContainer
return JSON.parse(
(
await container.execFail(
@@ -814,6 +819,7 @@ export class SystemForEmbassy implements System {
JSON.stringify(formData),
],
timeoutMs,
{ destroy: shouldDestroy },
)
).stdout.toString(),
)