// 返回是否作为新的失败请求被添加至队列尾部
767725
func (self *Spider) DoHistory(req *request.Request, ok bool) bool {
	return self.reqMatrix.DoHistory(req, ok)
}
51346
func New(cnf *config.Config, host, password, socketPath string, db int) iface.Backend {
	return &Backend{
		Backend:    common.NewBackend(cnf),
		host:       host,
		db:         db,
		password:   password,
		socketPath: socketPath,
	}
}
680674
func Append(err error, str string) error {
	return errors.New(fmt.Sprint(err) + str)
}
890024
func (deploy *Deploy) Reload() (*Response, error) {
	if deploy.Id == "" {
		return nil, errors.New("Cannot fetch deploy without an ID")
	}
	return deploy.client.Request("GET", deploy.apiPath(), nil, deploy)
}
381795
func (a *addrBook) init() {
	a.key = crypto.CRandHex(24) // 24/2 * 8 = 96 bits
	// New addr buckets
	a.bucketsNew = make([]map[string]*knownAddress, newBucketCount)
	for i := range a.bucketsNew {
		a.bucketsNew[i] = make(map[string]*knownAddress)
	}
	// Old addr buckets
	a.bucketsOld = make([]map[string]*knownAddress, oldBucketCount)
	for i := range a.bucketsOld {
		a.bucketsOld[i] = make(map[string]*knownAddress)
	}
}
896342
func (m *Module) New(state string) (string, error) {
	b, err := json.Marshal(&csrfPayload{
		State:       state,
		Token:       token.New32(),
		ExpireAfter: time.Now().Add(m.csrfValidityDuration),
	})
	if err != nil {
		return "", err
	}

	obj, err := m.encrypter.Encrypt(b)
	if err != nil {
		return "", err
	}

	msg, err := obj.CompactSerialize()
	if err != nil {
		return "", err
	}

	return msg, nil
}
946690
func (s *Map) Add(errType string, id string) {
	if strings.ToLower(errType) == OK {
		s.Valid++
	} else {
		if s.Invalid == nil {
			s.Invalid = make(map[string][]string)
		}
		s.Invalid[errType] = append(s.Invalid[errType], id)
	}
}
1082828
func (r *RetryInfo) AddAutoIncrementID(id int64) {
	r.autoIncrementIDs = append(r.autoIncrementIDs, id)
}
1067515
func (c *Client) Append(cmd string, args ...interface{}) {
	c.pending = append(c.pending, &request{cmd, args})
}
997606
func New(appID, appSecret string) *App {
	return &App{
		AppId:     appID,
		AppSecret: appSecret,
	}
}
322838
func New(errMsg string) *Error {
	if NewLine {
		errMsg += "\n"
	}
	return &Error{message: Prefix + errMsg}
}
816730
func (self *Logic) addNewTask() (tasksNum, spidersNum int) {
	length := self.SpiderQueue.Len()
	t := distribute.Task{}
	// 从配置读取字段
	self.setTask(&t)

	for i, sp := range self.SpiderQueue.GetAll() {

		t.Spiders = append(t.Spiders, map[string]string{"name": sp.GetName(), "keyin": sp.GetKeyin()})
		spidersNum++

		// 每十个蜘蛛存为一个任务
		if i > 0 && i%10 == 0 && length > 10 {
			// 存入
			one := t
			self.TaskJar.Push(&one)
			// logs.Log.App(" *     [新增任务]   详情： %#v", *t)

			tasksNum++

			// 清空spider
			t.Spiders = []map[string]string{}
		}
	}

	if len(t.Spiders) != 0 {
		// 存入
		one := t
		self.TaskJar.Push(&one)
		tasksNum++
	}
	return
}
559157
func (dc *DriverCall) Append(arg string) {
	dc.args = append(dc.args, arg)
}
51041
func (site *Site) Update() (*Response, error) {
	options := &RequestOptions{JsonBody: site.mutableParams()}

	return site.client.Request("PUT", site.apiPath(), options, site)
}
491202
func (db *DB) New(name []byte) (*Bucket, error) {
	err := db.Update(func(tx *bolt.Tx) error {
		_, err := tx.CreateBucketIfNotExists(name)
		if err != nil {
			return err
		}
		return nil
	})
	if err != nil {
		return nil, err
	}
	return &Bucket{db, name}, nil
}
432369
func (r *AppService) Insert(appinsertreq *AppInsertReq) *AppInsertCall {
	c := &AppInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
	c.appinsertreq = appinsertreq
	return c
}
1164113
func (a *BzzAddr) Update(na *BzzAddr) *BzzAddr {
	return &BzzAddr{a.OAddr, na.UAddr}
}