func (dj *DockerJob) Run() {
	defer dj.resetErr()
	if dj.Active {
		logrus.Debugf("Executing: %s on %s", dj.Action, dj.ID)
		switch dj.Action {
		case "start":
			dj.start()
		case "restart":
			dj.restart()
		case "stop":
			dj.stop()
		default:
			logrus.Errorf("Unsupported action: %s for container id: %s", dj.Action, dj.ID)
		}
	}
	if dj.Err() != nil {
		logrus.Error(dj.Err())
	}
}
Run Implements the job interface from cron package
package cron
import (
	"context"
	"strconv"
	"time"
	"github.com/Sirupsen/logrus"
	"github.com/docker/docker/api/types"
	"github.com/docker/docker/client"
)
type DockerJob struct {
	ID                 string
	Action             string
	Schedule           string
	Leader             bool
	Labels             map[string]string
	RancherServiceUUID string
	Active             bool
	lastError          error
	restartTimeout     time.Duration
}
func (dj *DockerJob) Err() error {
	return dj.lastError
}