MCPcopy Create free account
hub / github.com/cloudreve/cloudreve / GetTask

Method GetTask

pkg/cluster/node.go:286–307  ·  view source on GitHub ↗
(ctx context.Context, id int, clearOnComplete bool)

Source from the content-addressed store, hash-verified

284}
285
286func (n *slaveNode) GetTask(ctx context.Context, id int, clearOnComplete bool) (*SlaveTaskSummary, error) {
287 resp, err := n.client.Request(
288 "GET",
289 routes.SlaveGetTaskRoute(id, clearOnComplete),
290 nil,
291 request.WithContext(ctx),
292 request.WithLogger(logging.FromContext(ctx)),
293 ).CheckHTTPResponse(200).DecodeResponse()
294 if err != nil {
295 return nil, err
296 }
297
298 // 处理列取结果
299 if resp.Code != 0 {
300 return nil, serializer.NewErrorFromResponse(resp)
301 }
302
303 summary := &SlaveTaskSummary{}
304 resp.GobDecode(summary)
305
306 return summary, nil
307}
308
309func (b *slaveNode) CleanupFolders(ctx context.Context, folders ...string) error {
310 args := &FolderCleanup{

Callers

nothing calls this directly

Calls 9

SlaveGetTaskRouteFunction · 0.92
WithContextFunction · 0.92
WithLoggerFunction · 0.92
FromContextFunction · 0.92
NewErrorFromResponseFunction · 0.92
DecodeResponseMethod · 0.80
CheckHTTPResponseMethod · 0.80
GobDecodeMethod · 0.80
RequestMethod · 0.65

Tested by

no test coverage detected