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

Method DeleteBy

inventory/task.go:125–140  ·  view source on GitHub ↗
(ctx context.Context, args *DeleteTaskArgs)

Source from the content-addressed store, hash-verified

123}
124
125func (c *taskClient) DeleteBy(ctx context.Context, args *DeleteTaskArgs) error {
126 query := c.client.Task.
127 Delete().
128 Where(task.CreatedAtLTE(args.NotAfter))
129
130 if len(args.Status) > 0 {
131 query.Where(task.StatusIn(args.Status...))
132 }
133
134 if len(args.Types) > 0 {
135 query.Where(task.TypeIn(args.Types...))
136 }
137
138 _, err := query.Exec(ctx)
139 return err
140}
141
142func (c *taskClient) Update(ctx context.Context, task *ent.Task, args *TaskArgs) (*ent.Task, error) {
143 stm := c.client.Task.UpdateOne(task).

Callers

nothing calls this directly

Calls 6

CreatedAtLTEFunction · 0.92
StatusInFunction · 0.92
TypeInFunction · 0.92
DeleteMethod · 0.65
ExecMethod · 0.65
WhereMethod · 0.45

Tested by

no test coverage detected