Skip to content

Commit

Permalink
fix: handle both possible scheduler top level node names
Browse files Browse the repository at this point in the history
sometimes it is called `scheduler`, sometimes `entry`
  • Loading branch information
ianshade committed Jun 21, 2021
1 parent c61e5aa commit 5fbf986
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/mse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,10 @@ export class MSERep extends EventEmitter implements MSE {
async getEngines(): Promise<VizEngine[]> {
await this.checkConnection()
const handlers = await this.pep.getJS('/scheduler')
const vizEntries: AtomEntry[] = (handlers.js as any).entry.handler.filter((x: any) => x.$.type === 'viz')
const handlersBody = handlers.js as any
const vizEntries: AtomEntry[] = (handlersBody.entry || handlersBody.scheduler).handler.filter(
(x: any) => x.$.type === 'viz'
)
const viz = await Promise.all(vizEntries.map((x) => flattenEntry(x)))
return viz as VizEngine[]
}
Expand Down

0 comments on commit 5fbf986

Please sign in to comment.