don't close jobs queue, let GC handle it

This commit is contained in:
stryan 2020-04-11 17:24:47 -04:00
parent ba59914156
commit da39ba7b18
3 changed files with 2 additions and 2 deletions

View File

@ -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)

View File

@ -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, " ")

View File

@ -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)
} }