19 lines
349 B
Go
19 lines
349 B
Go
package tasks
|
|
|
|
import (
|
|
"encoding/json"
|
|
"github.com/hibiken/asynq"
|
|
"log/slog"
|
|
)
|
|
|
|
const RemoveChannel = "channel:remove"
|
|
|
|
func NewRemoveChannel(ids []int32) *asynq.Task {
|
|
bytes, err := json.Marshal(ids)
|
|
if err != nil {
|
|
slog.Error("序列化删除通道任务失败", "error", err)
|
|
return nil
|
|
}
|
|
return asynq.NewTask(RemoveChannel, bytes)
|
|
}
|