MCPcopy Create free account
hub / github.com/krau/SaveAny-Bot / NewBatchTGFileTask

Function NewBatchTGFileTask

core/tasks/batchtfile/task.go:80–106  ·  view source on GitHub ↗
(
	id string,
	ctx context.Context,
	files []TaskElement,
	progress ProgressTracker,
	ignoreErrors bool,
)

Source from the content-addressed store, hash-verified

78}
79
80func NewBatchTGFileTask(
81 id string,
82 ctx context.Context,
83 files []TaskElement,
84 progress ProgressTracker,
85 ignoreErrors bool,
86) *Task {
87 task := &Task{
88 ID: id,
89 ctx: ctx,
90 elems: files,
91 Progress: progress,
92 downloaded: atomic.Int64{},
93 totalSize: func() int64 {
94 var total int64
95 for _, elem := range files {
96 total += elem.File.Size()
97 }
98 return total
99 }(),
100 processing: make(map[string]TaskElementInfo),
101 IgnoreErrors: ignoreErrors,
102 processingMu: sync.RWMutex{},
103 failed: make(map[string]error),
104 }
105 return task
106}

Callers 2

createTGFilesTaskMethod · 0.92

Calls 1

SizeMethod · 0.65

Tested by

no test coverage detected