Fix race condition in create endpoint
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone Build is passing

This commit is contained in:
Adam Štrauch 2023-02-05 00:42:49 +01:00
parent 779d9ba95a
commit f3f50b0ace
Signed by: cx
GPG Key ID: 018304FFA8988F8D

View File

@ -231,6 +231,11 @@ func (p *Processor) Create(appTemplate apps.App) error {
}
}
err = container.Start()
if err != nil {
return fmt.Errorf("failed to start container: %v", err)
}
// Wait for the app to be created
err = p.waitForApp()
if err != nil {
@ -275,8 +280,7 @@ func (p *Processor) Create(appTemplate apps.App) error {
}
}
err = container.Start()
return fmt.Errorf("failed to start container: %v", err)
return nil
}
// Register registers app without creating a container for it