Other: Fix goroutine leak in OnStatusDown

We should spawn the goroutine as a bridge async task rather than as a
normal goroutine
This commit is contained in:
James Houlahan
2022-10-28 16:16:53 +02:00
parent bf4afae5d9
commit b72de5e3a4
2 changed files with 27 additions and 29 deletions

View File

@ -522,12 +522,12 @@ func (user *User) CheckAuth(email string, password []byte) (string, error) {
}
// OnStatusUp is called when the connection goes up.
func (user *User) OnStatusUp() {
func (user *User) OnStatusUp(context.Context) {
user.goSync()
}
// OnStatusDown is called when the connection goes down.
func (user *User) OnStatusDown() {
func (user *User) OnStatusDown(context.Context) {
user.abortable.Abort()
}