@@ -61,7 +61,6 @@ func (s *Service) ExecuteVisibleAndHiddenTestsAndSubmit(w http.ResponseWriter, r
61
61
}
62
62
63
63
// Save the collaboration history via the history-service
64
- // TODO: convert to message queue
65
64
submissionReq := models.Submission {
66
65
Code : submission .Code ,
67
66
Language : submission .Language ,
@@ -90,34 +89,6 @@ func (s *Service) ExecuteVisibleAndHiddenTestsAndSubmit(w http.ResponseWriter, r
90
89
return
91
90
}
92
91
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
-
121
92
w .Header ().Set ("Content-Type" , "application/json" )
122
93
w .WriteHeader (http .StatusOK )
123
94
json .NewEncoder (w ).Encode (testResults )
0 commit comments