Remove unused channel

This commit is contained in:
Noah Hilverling 2019-03-13 11:26:46 +01:00
parent e214bf5aa3
commit e47c38d06e

View file

@ -227,11 +227,8 @@ func SyncOperator(super *supervisor.Supervisor, chHA chan int) error {
var (
chInsert chan []string
chUpdate chan []string
chDelete chan []string
chInsertBack chan []configobject.Row
chUpdateBack chan []configobject.Row
chDeleteBack chan []configobject.Row
)
for msg := range chHA {
switch msg {
@ -240,21 +237,12 @@ func SyncOperator(super *supervisor.Supervisor, chHA chan int) error {
if chInsert != nil {
close(chInsert)
}
if chUpdate != nil {
close(chInsert)
}
if chDelete != nil {
close(chInsert)
close(chDelete)
}
if chInsertBack != nil {
close(chInsertBack)
}
if chUpdateBack != nil {
close(chUpdateBack)
}
if chDeleteBack != nil {
close(chDeleteBack)
}
case icingadb_ha.Notify_IsResponsible:
log.Info("Host: Got responsibility")
@ -262,17 +250,10 @@ func SyncOperator(super *supervisor.Supervisor, chHA chan int) error {
wgInsert.Add(len(insert))
chInsert = make(chan []string)
chUpdate = make(chan []string)
chDelete = make(chan []string)
chInsertBack = make(chan []configobject.Row)
chUpdateBack = make(chan []configobject.Row)
chDeleteBack = make(chan []configobject.Row)
go InsertPrepWorker(super, chInsert, chInsertBack)
//TODO: IMPLEMENT //go UpdatePrepWorker(super, chUpdate, chUpdateBack)
//TODO: IMPLEMENT //go DeletePrepWorker(super, chDelete, chDeleteBack)
go InsertExecWorker(super, chInsertBack, wgInsert)
go func() {