Open matjazonline opened 6 years ago
On GAE Standard Environment I encountered this error:
fatal error: all goroutines are asleep - deadlock!
Setup in init function:
`func init() { bot := mbotapi.NewBotAPI(PAGE_ACCESS_TKN, "whk", "sekret")
callbacks, mux := bot.SetWebhook("/webhook") var gaeCtx context.Context var handlerFunc http.HandlerFunc = func(w http.ResponseWriter, r *http.Request) { r = r.WithContext(appengine.NewContext(r)) gaeCtx = r.Context() mux.ServeHTTP(w, r) } http.Handle("/webhook", handlerFunc) for callback := range callbacks { log.Debugf(gaeCtx, "[%#v] %s", callback.Sender, callback.Message.Text) msg := mbotapi.NewMessage(callback.Message.Text) bot.Send(callback.Sender, msg, mbotapi.RegularNotif) }
}`
I see that otherwise mbotapi would work by setting GAE's urlfetch.Client pointer.
On GAE Standard Environment I encountered this error:
fatal error: all goroutines are asleep - deadlock!
Setup in init function:
`func init() { bot := mbotapi.NewBotAPI(PAGE_ACCESS_TKN, "whk", "sekret")
}`
I see that otherwise mbotapi would work by setting GAE's urlfetch.Client pointer.