plugin: honor LVMH_SESSION_ID (daemon-assigned id for spawned containers); e2e+smoke+integration green
This commit is contained in:
@@ -43,6 +43,9 @@ const ENV_URL: string = "LVMH_URL";
|
||||
const ENV_TOKEN: string = "LVMH_TOKEN";
|
||||
const ENV_AGENT: string = "LVMH_AGENT";
|
||||
const ENV_REPO: string = "LVMH_REPO";
|
||||
/** Daemon-assigned session id for spawned containers: takes precedence over
|
||||
* pi's own session id so web prompts route to the id /api/spawn returned. */
|
||||
const ENV_SESSION_ID: string = "LVMH_SESSION_ID";
|
||||
|
||||
const SEND_QUEUE_MAX: number = 1000;
|
||||
const REPLAY_BUFFER_MAX: number = 10000;
|
||||
@@ -619,6 +622,11 @@ export default function (pi: ExtensionAPI): void {
|
||||
log("no session id; lvmh mirroring disabled for this session");
|
||||
return;
|
||||
}
|
||||
const assignedId = process.env[ENV_SESSION_ID];
|
||||
if (typeof assignedId === "string" && assignedId.length > 0) {
|
||||
// Spawned container session: report the daemon-assigned id.
|
||||
sessionId = assignedId;
|
||||
}
|
||||
if (sessionId !== currentSessionId) {
|
||||
sendQueue = [];
|
||||
replayBuf = [];
|
||||
|
||||
Reference in New Issue
Block a user