Skip to content

Commit

Permalink
refactor: try to delay home path injection for ci
Browse files Browse the repository at this point in the history
  • Loading branch information
EagleoutIce committed Dec 27, 2024
1 parent 0a2f145 commit 1df7de0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/flowr/internal-session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ export class FlowrInternalSession implements FlowrSession {
this.outputChannel.appendLine(`Using options ${JSON.stringify(options)}`)

this.shell = new RShell(options)
this.shell.tryToInjectHomeLibPath()

// wait at most 1 second for the version, since the R shell doesn't let us know if the path
// we provided doesn't actually lead anywhere, or doesn't contain an R executable, etc.
let handle: NodeJS.Timeout
const timeout = new Promise<null>(resolve => handle = setTimeout(() => resolve(null), 1000))
const timeout = new Promise<null>(resolve => handle = setTimeout(() => resolve(null), 1500))
this.shell.tryToInjectHomeLibPath()
await Promise.race([this.shell.usedRVersion(), timeout]).then(version => {
clearTimeout(handle)
if(!version){
Expand Down

0 comments on commit 1df7de0

Please sign in to comment.