func (m *Manager) Check(name string) (int, error) {
	if len(name) == 0 {
		return -1, errors.New("job is missing a source repo")
	}
	j := &jobs.Job{
		Type: jobs.Check,
		Src:  name,
	}
	return m.store.Push(j)
}
Check compares an existing repo on Disk with its DB
package manager
import (
	"errors"
	"fmt"
	"github.com/getsolus/ferryd/config"
	"github.com/getsolus/ferryd/jobs"
	"github.com/getsolus/ferryd/repo"
	"github.com/getsolus/ferryd/util"
	"github.com/jmoiron/sqlx"
	"os"
	"path/filepath"
)
type singleRepoFunc func(r *repo.Repo, j *jobs.Job, tx *sqlx.Tx) error
func (m *Manager) singleRepoExecute(single singleRepoFunc, j *jobs.Job) error {
	if len(j.Src) == 0 {
		return errors.New("job is missing a source repo")
	}
	tx, err := m.db.Beginx()
	if err != nil {
		return fmt.Errorf("Failed to start DB transaction, reason: '%s'", err.Error())
	}
	r, err := repo.Get(tx, j.Src)
	if err != nil {
		tx.Rollback()
		return fmt.Errorf("Failed to get the Repo entry from the DB, reason: '%s'", err.Error())
	}
	if err = single(r, j, tx); err != nil {
		tx.Rollback()
		return err
	}
	if err = tx.Commit(); err != nil {
		return fmt.Errorf("Failed to remove the Repo from the DB, reason: '%s'", err.Error())
	}
	return nil
}