|
@@ -40,6 +40,7 @@ func setMqOptions(user, password string, opts *mqtt.ClientOptions) {
|
|
|
// SetupMQTT creates a connection to broker and return client
|
|
|
func SetupMQTT() {
|
|
|
if servercfg.GetBrokerType() == emqxBrokerType {
|
|
|
+ time.Sleep(7 * time.Second) // wait for the REST endpoint to be ready
|
|
|
// setup authenticator and create admin user
|
|
|
if err := CreateEmqxDefaultAuthenticator(); err != nil {
|
|
|
logger.Log(0, err.Error())
|