Beispiel #1
0
func (sd *cache) processRefresh() {
	rqst := &structs.NServiceRequest{
		Area: "all",
	}
	r, err := router.NewRPCCall("Services.All", rqst, servicesData.merge)
	if err != nil {
		log.Error(err.Error())
		return
	}
	err = r.Run()
	if err != nil {
		log.Error(err.Error())
		return
	}
	sd.indexAreaAdapters(sd.loadList())
	sd.switchList()
}
Beispiel #2
0
// run sends the request to the appropriate Adapter, and waits for a reponse.
func (c *CreateReq) run() (interface{}, error) {
	rqst, err := c.newNCreate()
	if err != nil {
		log.Error(err.Error())
		return nil, err
	}
	r, err := router.NewRPCCall("Report.Create", rqst, c.adapterReply)
	if err != nil {
		log.Error(err.Error())
		return nil, err
	}
	err = r.Run()
	if err != nil {
		log.Error(err.Error())
		return nil, err
	}
	return c.response, err
}