mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-12-08 10:50:24 +08:00
bfs:同一个Hash同时只能有一个Writer,避免多线程读冲突
This commit is contained in:
@@ -79,6 +79,10 @@ func (this *FileWriter) WriteBodyAt(b []byte, offset int64) (n int, err error) {
|
||||
}
|
||||
|
||||
func (this *FileWriter) Close() error {
|
||||
defer func() {
|
||||
this.bFile.removeWritingFile(this.hash)
|
||||
}()
|
||||
|
||||
if !this.isPartial && !this.hasMeta {
|
||||
return errors.New("no meta found")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user