don't close jobs queue, let GC handle it
This commit is contained in:
parent
ba59914156
commit
da39ba7b18
@ -54,7 +54,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
log.Println("Begining main phase")
|
log.Println("Begining main phase")
|
||||||
cancelChan := make(chan bool)
|
cancelChan := make(chan bool)
|
||||||
for i := 0; i < 1; i++ {
|
for i := 0; i < 4; i++ {
|
||||||
go func() {
|
go func() {
|
||||||
wg.Add(1)
|
wg.Add(1)
|
||||||
tb.MessageHandler(cancelChan)
|
tb.MessageHandler(cancelChan)
|
||||||
|
@ -20,6 +20,7 @@ func (t *TestBot) HandleMessage(e *mautrix.Event) {
|
|||||||
if e.Sender == t.Conf.Userid {
|
if e.Sender == t.Conf.Userid {
|
||||||
return //we don't care about our own messages
|
return //we don't care about our own messages
|
||||||
}
|
}
|
||||||
|
log.Printf("Handling message:'%v'\n", e.Content.Body)
|
||||||
body := e.Content.Body
|
body := e.Content.Body
|
||||||
body_s := strings.Split(body, " ")
|
body_s := strings.Split(body, " ")
|
||||||
|
|
||||||
|
@ -19,7 +19,6 @@ type TestBot struct {
|
|||||||
func (t *TestBot) Shutdown() {
|
func (t *TestBot) Shutdown() {
|
||||||
log.Printf("%v is shutting down", t.Conf.Name)
|
log.Printf("%v is shutting down", t.Conf.Name)
|
||||||
t.Bot.Client.StopSync()
|
t.Bot.Client.StopSync()
|
||||||
close(t.Jobs)
|
|
||||||
t.DumpState()
|
t.DumpState()
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user