// Resync resyncs with all the existing services that were there before we start
197892
func (c *cniProcessor) Resync(ctx context.Context, e *common.EventInfo) error {
	return nil
}
229168
func (keys *watchBrokerKeys) resync() error {
	iterators := map[string]datasync.KeyValIterator{}
	for _, keyPrefix := range keys.prefixes {
		it, err := keys.adapter.db.ListValues(keyPrefix)
		if err != nil {
			return errors.WithMessagef(err, "list values for %s failed", keyPrefix)
		}
		iterators[keyPrefix] = NewIterator(it)
	}

	resyncEvent := syncbase.NewResyncEventDB(context.Background(), iterators)

	select {
	case keys.resyncChan <- resyncEvent:
		// ok
	case <-time.After(ResyncAcceptTimeout):
		logrus.DefaultLogger().Warn("Timeout of resync send!")
		return errors.New("resync not accepted in time")
	}

	select {
	case err := <-resyncEvent.DoneChan:
		if err != nil {
			return errors.WithMessagef(err, "resync returned error")
		}
	case <-time.After(ResyncDoneTimeout):
		logrus.DefaultLogger().Warn("Timeout of resync callback!")
	}

	return nil
}
285250
func (_class ClusterClass) PoolResync(sessionID SessionRef, self ClusterRef) (_err error) {
	_method := "Cluster.pool_resync"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_selfArg, _err := convertClusterRefToXen(fmt.Sprintf("%s(%s)", _method, "self"), self)
	if _err != nil {
		return
	}
	_, _err =  _class.client.APICall(_method, _sessionIDArg, _selfArg)
	return
}
58065
func (c *Controller) Requeue(obj interface{}) error {
	return c.config.Queue.AddIfNotPresent(cache.Deltas{
		cache.Delta{
			Type:   cache.Sync,
			Object: obj,
		},
	})
}
621950
func (s *Snapshot) Services(node string) (memdb.ResultIterator, error) {
	iter, err := s.tx.Get("services", "node", node)
	if err != nil {
		return nil, err
	}
	return iter, nil
}
509922
func (mr *MockImplementationMockRecorder) Resync(ctx interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Resync", reflect.TypeOf((*MockImplementation)(nil).Resync), ctx)
}
1104113
func (o *Container) ContainerResyncs(info *bambou.FetchingInfo) (ContainerResyncsList, *bambou.Error) {

	var list ContainerResyncsList
	err := bambou.CurrentSession().FetchChildren(o, ContainerResyncIdentity, &list, info)
	return list, err
}
1335829
func (w *WalletState) RefreshAsync(mctx libkb.MetaContext, accountID stellar1.AccountID, reason string) error {
	a, ok := w.accountState(accountID)
	if !ok {
		return ErrAccountNotFound
	}

	// if someone calls this, they need a refresh to happen, so make
	// sure that the next refresh for this accountID isn't skipped.
	a.Lock()
	a.rtime = time.Time{}
	a.Unlock()

	select {
	case w.refreshReqs <- accountID:
	case <-time.After(200 * time.Millisecond):
		// don't wait for full channel
		mctx.Debug("refreshReqs channel clogged trying to enqueue %s for %q", accountID, reason)
		return ErrRefreshQueueFull
	}

	return nil
}
1151000
func (f *FIFO) Resync() error {
	f.lock.Lock()
	defer f.lock.Unlock()

	inQueue := sets.NewString()
	for _, id := range f.queue {
		inQueue.Insert(id)
	}
	for id := range f.items {
		if !inQueue.Has(id) {
			f.queue = append(f.queue, id)
		}
	}
	if len(f.queue) > 0 {
		f.cond.Broadcast()
	}
	return nil
}
190336
func NewSync(root common.Hash, database ethdb.Reader, callback LeafCallback) *Sync {
	ts := &Sync{
		database: database,
		membatch: newSyncMemBatch(),
		requests: make(map[common.Hash]*request),
		queue:    prque.New(nil),
	}
	ts.AddSubTrie(root, 0, common.Hash{}, callback)
	return ts
}
592920
func (r *configs) Reset() {
	r.mu.Lock()
	defer r.mu.Unlock()
	r.m = make(map[string]*api.Config)
}
819689
func DoSync(enableFileSync bool) FileStoreOption {
	return func(o *FileStoreOptions) error {
		o.DoSync = enableFileSync
		return nil
	}
}
389783
func (self *Service) Redeploy(reuse_volume ReuseVolumesOption) error {

	url := ""
	if reuse_volume.Reuse != true {
		url = "service/" + self.Uuid + "/redeploy/?reuse_volumes=false"
	} else {
		url = "service/" + self.Uuid + "/redeploy/"
	}

	request := "POST"
	//Empty Body Request
	body := []byte(`{}`)

	_, err := TutumCall(url, request, body)
	if err != nil {
		return err
	}

	return nil
}
33553
func (l *Listener) resync(cn *ListenerConn, notificationChan <-chan *Notification) error {
	doneChan := make(chan error)
	go func() {
		for channel := range l.channels {
			// If we got a response, return that error to our caller as it's
			// going to be more descriptive than cn.Err().
			gotResponse, err := cn.Listen(channel)
			if gotResponse && err != nil {
				doneChan <- err
				return
			}

			// If we couldn't reach the server, wait for notificationChan to
			// close and then return the error message from the connection, as
			// per ListenerConn's interface.
			if err != nil {
				for _ = range notificationChan {
				}
				doneChan <- cn.Err()
				return
			}
		}
		doneChan <- nil
	}()

	// Ignore notifications while synchronization is going on to avoid
	// deadlocks.  We have to send a nil notification over Notify anyway as
	// we can't possibly know which notifications (if any) were lost while
	// the connection was down, so there's no reason to try and process
	// these messages at all.
	for {
		select {
		case _, ok := <-notificationChan:
			if !ok {
				notificationChan = nil
			}

		case err := <-doneChan:
			return err
		}
	}
}
109954
func (db *GoLevelDB) SetSync(key []byte, value []byte) {
	key = nonNilBytes(key)
	value = nonNilBytes(value)
	err := db.db.Put(key, value, &opt.WriteOptions{Sync: true})
	if err != nil {
		cmn.PanicCrisis(err)
	}
}
387880
func (c *config) Sync() error {
	if err := c.opts.Loader.Sync(); err != nil {
		return err
	}

	snap, err := c.opts.Loader.Snapshot()
	if err != nil {
		return err
	}

	c.Lock()
	defer c.Unlock()

	c.snap = snap
	vals, err := c.opts.Reader.Values(snap.ChangeSet)
	if err != nil {
		return err
	}
	c.vals = vals

	return nil
}
466368
func (a *Agent) reapServices() {
	for {
		select {
		case <-time.After(a.config.CheckReapInterval):
			a.reapServicesInternal()

		case <-a.shutdownCh:
			return
		}
	}

}