feat: use "GetTags" and "SetTags"

This commit is contained in:
sujit
2025-05-05 09:07:01 +05:45
parent b5e6c29ffb
commit 28870f1629
4 changed files with 150 additions and 45 deletions

View File

@@ -68,6 +68,8 @@ type Task struct {
Status string `json:"status"`
Payload json.RawMessage `json:"payload"`
dag any
// new deduplication field
DedupKey string `json:"dedup_key,omitempty"`
}
func (t *Task) GetFlow() any {
@@ -84,3 +86,10 @@ func NewTask(id string, payload json.RawMessage, nodeKey string, opts ...TaskOpt
}
return task
}
// new TaskOption for deduplication:
func WithDedupKey(key string) TaskOption {
return func(t *Task) {
t.DedupKey = key
}
}