Remove concurrency
This commit is contained in:
@ -92,7 +92,11 @@ func (app *application) CreateElection(w http.ResponseWriter, r *http.Request) {
|
|||||||
randomIdentity := randomVoterIdentity()
|
randomIdentity := randomVoterIdentity()
|
||||||
voterIdentities = append(voterIdentities, randomIdentity)
|
voterIdentities = append(voterIdentities, randomIdentity)
|
||||||
}
|
}
|
||||||
go app.voters.InsertMultiple(voterIdentities, electionId)
|
_, err = app.voters.InsertMultiple(voterIdentities, electionId)
|
||||||
|
if err != nil {
|
||||||
|
app.serverError(w, r, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
res, err = json.Marshal(api.CreateElectionResponse{VoterIdentities: &voterIdentities})
|
res, err = json.Marshal(api.CreateElectionResponse{VoterIdentities: &voterIdentities})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Reference in New Issue
Block a user