mirror of
https://github.com/serverless/serverless.git
synced 2026-01-18 14:58:43 +00:00
Merge pull request #5793 from serverless/fix-yml-race-condition
Fix race condition when loading config file
This commit is contained in:
commit
4a64f4a7bc
@ -55,27 +55,26 @@ class Serverless {
|
||||
// get an array of commands and options that should be processed
|
||||
this.processedInput = this.cli.processInput();
|
||||
|
||||
// make the serverless config file available to the PluginManager
|
||||
this.pluginManager.loadConfigFile();
|
||||
// load config file
|
||||
return this.pluginManager.loadConfigFile().then(() => {
|
||||
// set the options and commands which were processed by the CLI
|
||||
this.pluginManager.setCliOptions(this.processedInput.options);
|
||||
this.pluginManager.setCliCommands(this.processedInput.commands);
|
||||
|
||||
// set the options and commands which were processed by the CLI
|
||||
this.pluginManager.setCliOptions(this.processedInput.options);
|
||||
this.pluginManager.setCliCommands(this.processedInput.commands);
|
||||
// Check if update is available
|
||||
updateNotifier({ pkg }).notify();
|
||||
|
||||
// Check if update is available
|
||||
updateNotifier({ pkg }).notify();
|
||||
return this.service.load(this.processedInput.options);
|
||||
}).then(() => {
|
||||
// load all plugins
|
||||
this.pluginManager.loadAllPlugins(this.service.plugins);
|
||||
|
||||
return this.service.load(this.processedInput.options)
|
||||
.then(() => {
|
||||
// load all plugins
|
||||
this.pluginManager.loadAllPlugins(this.service.plugins);
|
||||
|
||||
// give the CLI the plugins and commands so that it can print out
|
||||
// information such as options when the user enters --help
|
||||
this.cli.setLoadedPlugins(this.pluginManager.getPlugins());
|
||||
this.cli.setLoadedCommands(this.pluginManager.getCommands());
|
||||
return this.pluginManager.updateAutocompleteCacheFile();
|
||||
});
|
||||
// give the CLI the plugins and commands so that it can print out
|
||||
// information such as options when the user enters --help
|
||||
this.cli.setLoadedPlugins(this.pluginManager.getPlugins());
|
||||
this.cli.setLoadedCommands(this.pluginManager.getCommands());
|
||||
return this.pluginManager.updateAutocompleteCacheFile();
|
||||
});
|
||||
}
|
||||
|
||||
run() {
|
||||
|
||||
@ -42,9 +42,11 @@ class PluginManager {
|
||||
}
|
||||
|
||||
loadConfigFile() {
|
||||
getServerlessConfigFile(this.serverless.config.servicePath).then((serverlessConfigFile) => {
|
||||
this.serverlessConfigFile = serverlessConfigFile;
|
||||
});
|
||||
return getServerlessConfigFile(this.serverless.config.servicePath)
|
||||
.then((serverlessConfigFile) => {
|
||||
this.serverlessConfigFile = serverlessConfigFile;
|
||||
return;
|
||||
});
|
||||
}
|
||||
|
||||
setCliOptions(options) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user