move the start process to a go routine to avoid blocking main thread
cr
@@ -76,11 +76,15 @@ func start(log logger.T, instanceIDPtr *string, regionPtr *string, shouldCheckHi
ssmAgent = agent.NewSSMAgent(context, healthModule, hibernateState)
// Initialize the startup module during agent start, before agent can potentially enter hibernation mode
+ if !context.AppConfig().Agent.ContainerMode {
+ go func() {
process = startup.NewProcessor(context)
processErr := process.ModuleExecute(context)
if processErr != nil {
log.Errorf("Error occurred during startup of processor: %v", processErr)
}
+ }()
+ }
// Do a health check before starting the agent.
// Health check would include creating a health module and sending empty health pings to the service.
