From ef559bb973d8c2ddabc5b9cdb6b4972057a63e56 Mon Sep 17 00:00:00 2001 From: tanganyu <569386693@qq.com> Date: Mon, 28 Dec 2020 18:08:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=A8=8B=E5=BA=8F=E9=80=80?= =?UTF-8?q?=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- model/model.go | 2 -- write/write.go | 4 ++++ 2 files changed, 4 insertions(+), 2 deletions(-) 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() {