func (c *concurrentTaskInfoMap) setStatus(k string, s Status) {
	if info, ok := c.get(k); ok {
		info.status = s
		c.put(k, info)
		return
	}
}
setStatus sets the status of k if it is already in the map
package tasks
import (
	"math/rand"
	"runtime/debug"
	"sync"
	"time"
	log "github.com/Sirupsen/logrus"
	"github.com/juju/errors"
)
type Status int
type TaskExecuter interface {
	QueueTask(task func(string) error, onFailure func(string, string)) string
	GetTaskStatus(id string) Status
	completeTask(id string, task func(string) error, onFailure func(string, string))
}
type taskInfo struct {
	status  Status
	started time.Time
}
type concurrentTaskInfoMap struct {
	sync.RWMutex
	m map[string]taskInfo
}
type defaultExecuter struct {
	cMap       concurrentTaskInfoMap
	expiration time.Duration
}
const (
	INPROGRESS Status = iota
	SUCCESS
	FAILURE
	NOTFOUND
)
var DefaultTaskExecuter = NewTaskExecuter(time.Hour * 24)
func (c *concurrentTaskInfoMap) put(k string, v taskInfo) {
	c.Lock()
	c.m[k] = v
	c.Unlock()
}
func (c *concurrentTaskInfoMap) get(k string) (taskInfo, bool) {
	c.RLock()
	v, ok := c.m[k]
	c.RUnlock()
	return v, ok
}