Skip to content

Instantly share code, notes, and snippets.

@demosifter
Last active October 4, 2017 11:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save demosifter/cb72694efa31ef195ea67aa19498ab99 to your computer and use it in GitHub Desktop.
Save demosifter/cb72694efa31ef195ea67aa19498ab99 to your computer and use it in GitHub Desktop.
func Compute(req sandboxrpc.ComputeRequest) ([]sandboxrpc.ComputeResponse, error) {
idx, err := utils.OpenIndex(false)
if err != nil {
return nil, errors.New("Something went wrong while creating the index: " + err.Error())
}
defer idx.Close()
datums, err := fetchMajesticCSV()
if err != nil {
return nil, err
}
err = utils.UpdateIndex(idx, datums)
if err != nil {
return nil, err
}
return []sandboxrpc.ComputeResponse{utils.ExportStats(idx)}, nil
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment