Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: run dependencies in sequenced order #464

Closed
wants to merge 4 commits into from
Closed
Changes from 2 commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -162,6 +162,7 @@ class AppManager extends EventEmitter {

const { dependencies } = app
if (dependencies) {
var sequence = Promise.resolve()
This conversation was marked as resolved by ryanio

This comment has been minimized.

Copy link
@marcgarreau

marcgarreau Sep 6, 2019

Collaborator

this is an unusual pattern, so may be worth adding the stackoverflow link as a comment above this for context

This comment has been minimized.

Copy link
@ryanio

ryanio Sep 6, 2019

Author Collaborator

added, thanks

dependencies.forEach(async dependency => {
console.log('Found dependency: ', dependency)
const plugin = global.PluginHost.getPluginByName(dependency.name)
@@ -195,14 +196,16 @@ class AppManager extends EventEmitter {
const flags = generateFlags(config, settings)
const release = undefined // TODO: allow apps to choose specific release?
console.log('Request start: ', app, flags, release)
try {
// TODO: show progress to user
await plugin.requestStart(app, flags, release)
} catch (error) {
// e.g. user cancelled
console.log('Error: ', error)
return // do NOT start in this case
}
sequence = sequence.then(async () => {
try {
// TODO: show progress to user
await plugin.requestStart(app, flags, release)
} catch (error) {
// e.g. user cancelled
console.log('Error: ', error)
return // do NOT start in this case
}
})
}
})
}
@@ -50,10 +50,11 @@
"screenshot": "https://i.imgur.com/J2tK9Dg.png",
"url": "package://github.com/ryanio/grid-clef-app",
"dependencies": [
{ "name": "geth", "settings": [{ "signer": "clef" }] },
{
"name": "clef"
}
"name": "clef",
"settings": [{ "id": "api", "value": "http" }]
},
{ "name": "geth", "settings": [{ "id": "signer", "value": "clef" }] }
]
}
]
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.