Fixed delay of stanca presence messages
This commit is contained in:
2
main.go
2
main.go
@@ -36,7 +36,7 @@ func main() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
// Delay before sending another message
|
// Delay before sending another message
|
||||||
time.Sleep(time.Duration(appConfig.AppConfig.GeneralOptions.PresenceStatusDelay))
|
time.Sleep(time.Duration(appConfig.AppConfig.GeneralOptions.PresenceStatusDelay * 1000000000))
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -117,12 +117,11 @@ func Init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
|
defer wg.Done()
|
||||||
statusMesageDelay := int64(rand.Intn(appConfig.AppConfig.GeneralOptions.CommandReplyDelay))
|
statusMesageDelay := int64(rand.Intn(appConfig.AppConfig.GeneralOptions.CommandReplyDelay))
|
||||||
log.Printf("DELAYING FOR: %v", statusMesageDelay*1000000000)
|
log.Printf("DELAYING FOR: %v", statusMesageDelay*1000000000)
|
||||||
// Delay For two seccond to allow all clients to connect
|
// Delay For two seccond to allow all clients to connect
|
||||||
time.Sleep(time.Duration(statusMesageDelay * 1000000000))
|
time.Sleep(time.Duration(statusMesageDelay * 1000000000))
|
||||||
defer wg.Done()
|
|
||||||
|
|
||||||
client, err := xmpp.NewClient(&xmppClient.Config, xmppService.Router, errorHandler)
|
client, err := xmpp.NewClient(&xmppClient.Config, xmppService.Router, errorHandler)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user