// updateDeveloper gets the most up to date dev data and saves it. func updateDeveloper(dev *db.Developer) error { // Get the developer from the devs token. developer, err := broome.GetDeveloper(dev.Token) if err != nil { return err } // Save the developer. log.Debug("Found developer", developer) dev.Developer = developer return dev.Save() }
// devUpToDate checks if a developers token is up to date. func devUpToDate(dev *db.Developer) (bool, error) { remoteDev, err := broome.GetDeveloper(dev.Token) if err != nil && err != errors.ErrInvalidToken { return false, err } if remoteDev != nil && dev.Token == remoteDev.Token { return true, nil } return false, nil }