(userEnvProbe: UserEnvProbe, params: { output: Log; containerSessionDataFolder?: string }, shellServer?: ShellServer)
| 796 | } |
| 797 | |
| 798 | async function readUserEnvFromCache(userEnvProbe: UserEnvProbe, params: { output: Log; containerSessionDataFolder?: string }, shellServer?: ShellServer) { |
| 799 | if (!shellServer || !params.containerSessionDataFolder) { |
| 800 | return undefined; |
| 801 | } |
| 802 | |
| 803 | const cacheFile = getUserEnvCacheFilePath(userEnvProbe, params.containerSessionDataFolder); |
| 804 | try { |
| 805 | if (await isFile(shellServer, cacheFile)) { |
| 806 | const { stdout } = await shellServer.exec(`cat '${cacheFile}'`); |
| 807 | return JSON.parse(stdout); |
| 808 | } |
| 809 | } |
| 810 | catch (e) { |
| 811 | params.output.write(`Failed to read/parse user env cache: ${e}`, LogLevel.Error); |
| 812 | } |
| 813 | |
| 814 | return undefined; |
| 815 | } |
| 816 | |
| 817 | async function updateUserEnvCache(env: Record<string, string>, userEnvProbe: UserEnvProbe, params: { output: Log; containerSessionDataFolder?: string }, shellServer?: ShellServer) { |
| 818 | if (!shellServer || !params.containerSessionDataFolder) { |
no test coverage detected