Skip to content

Commit

Permalink
style(execution-service): 🔥 remove commented code
Browse files Browse the repository at this point in the history
Revmoes the previous commented implementation of sending the submission to history service via REST API call.
  • Loading branch information
tituschewxj committed Nov 7, 2024
1 parent fac4430 commit d75215c
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions apps/execution-service/handlers/submit.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ func (s *Service) ExecuteVisibleAndHiddenTestsAndSubmit(w http.ResponseWriter, r
}

// Save the collaboration history via the history-service
// TODO: convert to message queue
submissionReq := models.Submission{
Code: submission.Code,
Language: submission.Language,
Expand Down Expand Up @@ -90,34 +89,6 @@ func (s *Service) ExecuteVisibleAndHiddenTestsAndSubmit(w http.ResponseWriter, r
return
}

// get history-service url from os env
// historyServiceUrl := os.Getenv("HISTORY_SERVICE_URL")
// if historyServiceUrl == "" {
// http.Error(w, "HISTORY_SERVICE_URL is not set", http.StatusInternalServerError)
// return
// }

// req, err := http.NewRequest(http.MethodPost, historyServiceUrl+"histories",
// bytes.NewBuffer(jsonData))
// if err != nil {
// http.Error(w, err.Error(), http.StatusInternalServerError)
// return
// }

// req.Header.Set("Content-Type", "application/json")

// client := &http.Client{}
// resp, err := client.Do(req)
// if err != nil {
// http.Error(w, err.Error(), http.StatusInternalServerError)
// return
// }
// defer resp.Body.Close()

// if resp.StatusCode != http.StatusOK {
// http.Error(w, "Failed to save submission history", http.StatusInternalServerError)
// }

w.Header().Set("Content-Type", "application/json")
w.WriteHeader(http.StatusOK)
json.NewEncoder(w).Encode(testResults)
Expand Down

0 comments on commit d75215c

Please sign in to comment.