diff --git a/model/model.go b/model/model.go index 5985772..bb77eab 100644 --- a/model/model.go +++ b/model/model.go @@ -7,8 +7,6 @@ var ( ControlCH = make(chan int, 10) // 通道传递信息到record协程 RecordCH = make(chan Record, 10) - /* // 读写取数通道,写入2次,删除/Link各取一次 - HashMapCH = make(chan map[string][]string,1)*/ // 记录文件hash值的map FileMap = make(map[string][]string) // 记录文件大小 diff --git a/write/write.go b/write/write.go index 5f02927..963f9a3 100644 --- a/write/write.go +++ b/write/write.go @@ -15,7 +15,11 @@ func Write(dm string) { if dm == "ln" { CreateLink() } + // 退出协程 关闭通道 model.SignalCH <- true + close(model.SignalCH) + close(model.RecordCH) + close(model.ControlCH) } func RemoveFile() {