Skip to content

Commit d75215c

Browse files
committed
style(execution-service): 🔥 remove commented code
Revmoes the previous commented implementation of sending the submission to history service via REST API call.
1 parent fac4430 commit d75215c

File tree

1 file changed

+0
-29
lines changed

1 file changed

+0
-29
lines changed

apps/execution-service/handlers/submit.go

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ func (s *Service) ExecuteVisibleAndHiddenTestsAndSubmit(w http.ResponseWriter, r
6161
}
6262

6363
// Save the collaboration history via the history-service
64-
// TODO: convert to message queue
6564
submissionReq := models.Submission{
6665
Code: submission.Code,
6766
Language: submission.Language,
@@ -90,34 +89,6 @@ func (s *Service) ExecuteVisibleAndHiddenTestsAndSubmit(w http.ResponseWriter, r
9089
return
9190
}
9291

93-
// get history-service url from os env
94-
// historyServiceUrl := os.Getenv("HISTORY_SERVICE_URL")
95-
// if historyServiceUrl == "" {
96-
// http.Error(w, "HISTORY_SERVICE_URL is not set", http.StatusInternalServerError)
97-
// return
98-
// }
99-
100-
// req, err := http.NewRequest(http.MethodPost, historyServiceUrl+"histories",
101-
// bytes.NewBuffer(jsonData))
102-
// if err != nil {
103-
// http.Error(w, err.Error(), http.StatusInternalServerError)
104-
// return
105-
// }
106-
107-
// req.Header.Set("Content-Type", "application/json")
108-
109-
// client := &http.Client{}
110-
// resp, err := client.Do(req)
111-
// if err != nil {
112-
// http.Error(w, err.Error(), http.StatusInternalServerError)
113-
// return
114-
// }
115-
// defer resp.Body.Close()
116-
117-
// if resp.StatusCode != http.StatusOK {
118-
// http.Error(w, "Failed to save submission history", http.StatusInternalServerError)
119-
// }
120-
12192
w.Header().Set("Content-Type", "application/json")
12293
w.WriteHeader(http.StatusOK)
12394
json.NewEncoder(w).Encode(testResults)

0 commit comments

Comments
 (0)