func (s *Server) doFetch(r *http.Request) (string, int) {
	modulePath, version, err := parseModulePathAndVersion(r.URL.Path)
	if err != nil {
		return err.Error(), http.StatusBadRequest
	}

	code, err := FetchAndUpdateState(r.Context(), modulePath, version, s.proxyClient, s.sourceClient, s.db, s.cfg.AppVersionLabel())
	if err != nil {
		return err.Error(), code
	}
	return fmt.Sprintf("fetched and updated %s@%s", modulePath, version), code
}
// doFetch executes a fetch request and returns the msg and status.
doFetch executes a fetch request and returns the msg and status.
// doFetch executes a fetch request and returns the msg and status .
func (s *Server) doFetch(r *http.Request) (string, int) {
	modulePath, version, err := parseModulePathAndVersion(r.URL.Path)
	if err != nil {
		return err.Error(), http.StatusBadRequest
	}
	code, err := FetchAndUpdateState(r.Context(), modulePath, version, s.proxyClient, s.sourceClient, s.db, s.cfg.AppVersionLabel())
	if err != nil {
		return err.Error(), code
	}
	return fmt.Sprintf("fetched and updated %s@%s", modulePath, version), code
}
func ( s * Server ) doFetch ( r * http . Request ) ( string , int ) { modulePath , version , err := parseModulePathAndVersion ( r . URL . Path ) if err != nil { return err . Error ( ) , http . StatusBadRequest } code , err := FetchAndUpdateState ( r . Context ( ) , modulePath , version , s . proxyClient , s . sourceClient , s . db , s . cfg . AppVersionLabel ( ) ) if err != nil { return err . Error ( ) , code } return fmt . Sprintf ( " " , modulePath , version ) , code }
doFetch executes a fetch request and returns the msg and status.
doFetch executes a fetch request and returns the msg and status .