Last active
October 4, 2017 11:35
-
-
Save demosifter/cb72694efa31ef195ea67aa19498ab99 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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