             
             notifyCompletionCallback( Result.success(diggerSeed.cacheFileURL), diggerSeed)
             
-            DiggerCache.moveItem(atPath: diggerSeed.tempPath, toPath: diggerSeed.cachePath)
         }
         
         diggerSeed.outputStream?.close()

    
    /// speed shoul be zero, when cancel or suspend
    
    public func notifySpeedZeroCallbackZero(_ diggerSeed : DiggerSeed){
        DispatchQueue.main.safeAsync {
            _ = diggerSeed.callbacks.map{ $0.speed?(0) }


                // If a task is cancelled, the temporary file will be deleted
                DiggerCache.removeItem(atPath: diggerSeed.tempPath)
                
            }
            
            diggerLog(error)
            
        case .success(let url) :
            
            DiggerCache.moveItem(atPath: diggerSeed.tempPath, toPath: diggerSeed.cachePath)
            
            diggerLog("download success \n" + url.absoluteString)
            
        }
        
        manager.removeDigeerSeed(for: diggerSeed.url)

        DispatchQueue.main.safeAsync {
            _ = diggerSeed.callbacks.map{ $0.completion?(result) }
        }
        notifySpeedZeroCallback(diggerSeed)
        
        
        
