示例#1
0
// Trigger a sync of the local repository
func (m *Monitor) scanRepository() error {
	err := scan.ScanSource(m.redis, m.stop)
	if err != nil {
		log.Error("Scanning source failed: %s", err.Error())
	}
	return err
}
示例#2
0
func (c *cli) CmdRefresh(args ...string) error {
	cmd := SubCmd("refresh", "", "Scan the local repository")

	if err := cmd.Parse(args); err != nil {
		return nil
	}
	if cmd.NArg() != 0 {
		cmd.Usage()
		return nil
	}

	err := scan.ScanSource(database.NewRedis(), nil)
	return err
}