// CreateAndRefresh creates an object from input info and refreshes info with that object
965161
func CreateAndRefresh(info *Info) error {
	obj, err := NewHelper(info.Client, info.Mapping).Create(info.Namespace, true, info.Object, nil)
	if err != nil {
		return err
	}
	info.Refresh(obj, true)
	return nil
}
455829
func (s *MgetService) Refresh(refresh string) *MgetService {
	s.refresh = refresh
	return s
}
545760
func (s *Sensor) Refresh() error {
	sensor, err := s.Bridge.GetSensorByIndex(s.Index)
	if err != nil {
		return err
	}

	s.State = sensor.State
	s.Config = sensor.Config
	s.SWVersion = sensor.SWVersion
	s.Name = sensor.Name
	return nil
}
1836
func NewRef(refresh time.Duration, context Context, chConfigRef *lazyref.Reference) *Ref {
	ref := &Ref{
		chConfigRef: chConfigRef,
		context:     context,
	}

	ref.Reference = lazyref.New(
		ref.initializer(),
		lazyref.WithRefreshInterval(lazyref.InitImmediately, refresh),
	)

	return ref
}
326632
func (tab *Table) doRefresh(done chan struct{}) {
	defer close(done)

	// Load nodes from the database and insert
	// them. This should yield a few previously seen nodes that are
	// (hopefully) still alive.
	tab.loadSeedNodes()

	// Run self lookup to discover new neighbor nodes.
	tab.net.lookupSelf()

	// The Kademlia paper specifies that the bucket refresh should
	// perform a lookup in the least recently used bucket. We cannot
	// adhere to this because the findnode target is a 512bit value
	// (not hash-sized) and it is not easily possible to generate a
	// sha3 preimage that falls into a chosen bucket.
	// We perform a few lookups with a random target instead.
	for i := 0; i < 3; i++ {
		tab.net.lookupRandom()
	}
}
444339
func (s *releasesService) CreateAndRelease(ctx context.Context, db *gorm.DB, r *Release, ss twelvefactor.StatusStream) (*Release, error) {
	r, err := s.Create(ctx, db, r)
	if err != nil {
		return r, err
	}
	// Schedule the new release onto the cluster.
	return r, s.Release(ctx, r, ss)
}
1294764
func (s *DeleteService) Refresh(refresh string) *DeleteService {
	s.refresh = refresh
	return s
}
262592
func WithRefreshInterval(value time.Duration) coptions.Opt {
	return func(p coptions.Params) {
		if setter, ok := p.(refreshIntervalSetter); ok {
			setter.SetChConfigRefreshInterval(value)
		}
	}
}
1283931
func (s *AuthenticationResultType) SetRefreshToken(v string) *AuthenticationResultType {
	s.RefreshToken = &v
	return s
}
579594
func (u *UniterAPI) Refresh(args params.Entities) (params.UnitRefreshResults, error) {
	result := params.UnitRefreshResults{
		Results: make([]params.UnitRefreshResult, len(args.Entities)),
	}
	if len(args.Entities) == 0 {
		return result, nil
	}
	canRead, err := u.accessUnit()
	if err != nil {
		return params.UnitRefreshResults{}, err
	}
	for i, entity := range args.Entities {
		tag, err := names.ParseUnitTag(entity.Tag)
		if err != nil {
			result.Results[i].Error = common.ServerError(common.ErrPerm)
			continue
		}
		err = common.ErrPerm
		if canRead(tag) {
			var unit *state.Unit
			if unit, err = u.getUnit(tag); err == nil {
				result.Results[i].Life = params.Life(unit.Life().String())
				result.Results[i].Resolved = params.ResolvedMode(unit.Resolved())
			}
		}
		result.Results[i].Error = common.ServerError(err)
	}
	return result, nil
}
1317876
func (s *ExistsService) Refresh(refresh bool) *ExistsService {
	s.refresh = &refresh
	return s
}
953515
func (m *Registry) SchemaRefresh(name string) error {
	m.mu.RLock()
	s, ok := m.schemas[name]
	m.mu.RUnlock()
	if !ok {
		return ErrNotFound
	}
	return m.applyer.AddOrUpdateOnSchema(s, s)
}
726873
func (h *Harness) Refresh() (err *utils.Error) {
	// Allow only one thread to rebuild the process
	// If multiple requests to rebuild are queued only the last one is executed on
	// So before a build is started we wait for a second to determine if
	// more requests for a build are triggered.
	// Once no more requests are triggered the build will be processed
	h.mutex.Lock()
	defer h.mutex.Unlock()

	if h.app != nil {
		h.app.Kill()
	}

	utils.Logger.Info("Rebuild Called")
	var newErr error
	h.app, newErr = Build(h.config, h.paths)
	if newErr != nil {
		utils.Logger.Error("Build detected an error", "error", newErr)
		if castErr, ok := newErr.(*utils.Error); ok {
			return castErr
		}
		err = &utils.Error{
			Title:       "App failed to start up",
			Description: err.Error(),
		}
		return
	}

	if h.useProxy {
		h.app.Port = h.port
		if err2 := h.app.Cmd(h.runMode).Start(h.config); err2 != nil {
			utils.Logger.Error("Could not start application", "error", err2)
			if err,k :=err2.(*utils.Error);k {
				return err
			}
			return &utils.Error{
				Title:       "App failed to start up",
				Description: err2.Error(),
			}
		}
	} else {
		h.app = nil
	}

	return
}
1129224
func (m *Machine) Refresh() error {
	life, err := common.OneLife(m.facade, m.tag)
	if err != nil {
		return errors.Trace(err)
	}
	m.life = life
	return nil
}
122793
func (c *CloudService) Refresh() error {
	_, err := c.CloudService()
	return errors.Trace(err)
}
165749
func (s *GetService) Refresh(refresh string) *GetService {
	s.refresh = refresh
	return s
}
828089
func (s *Storage) LoadRefresh(code string) (*osin.AccessData, error) {
	row := s.db.QueryRow("SELECT access FROM refresh WHERE token=$1 LIMIT 1", code)
	var access string
	if err := row.Scan(&access); err == sql.ErrNoRows {
		return nil, pkg.ErrNotFound
	} else if err != nil {
		return nil, errors.New(err)
	}
	return s.LoadAccess(access)
}