func GetTask(id string) (*Task, error) {
	if !DoesTaskExist(id) {
		return &Task{}, TaskDoesNotExistErr
	}
	taskMutex.RLock()
	defer taskMutex.RUnlock()
	return tasks[id], nil
}
GetTask gets a task
package task
import (
	"errors"
	"github.com/EdwinJ0124/bot-base/internal/profile"
	"github.com/lithammer/shortuuid"
	"sync"
)
var (
	taskMutex = sync.RWMutex{}
	TaskDoesNotExistErr = errors.New("task does not exist")
	tasks = make(map[string]*Task)
)
func DoesTaskExist(id string) bool {
	taskMutex.RLock()
	defer taskMutex.RUnlock()
	_, ok := tasks[id]
	return ok
}
func CreateTask(taskType, site, product string) string {
	taskMutex.Lock()
	defer taskMutex.Unlock()
	id := shortuuid.New()
	tasks[id] = &Task{
		Type:    taskType,
		Site:    site,
		Product: product,
	}
	return id
}
func RemoveTask(id string) error {
	if !DoesTaskExist(id) {
		return TaskDoesNotExistErr
	}
	taskMutex.Lock()
	defer taskMutex.Unlock()
	task := tasks[id]
	task.Cancel()
	delete(tasks, id)
	return nil
}