| 217 | } |
| 218 | |
| 219 | func (s *DispatchServerV2) runnerHandler(w http.ResponseWriter, r *http.Request) { |
| 220 | runtimeID := r.Header.Get("x-cfc-runtimeid") |
| 221 | logs.Infof("runner %s connect", runtimeID) |
| 222 | |
| 223 | conn, buf, ok := setupHijackConn(w, r) |
| 224 | if !ok { |
| 225 | logs.Errorf("setupHijackConn runtime %s failed", runtimeID) |
| 226 | return |
| 227 | } |
| 228 | |
| 229 | rt, err := s.runtimeDispatcher.GetRuntime(runtimeID) |
| 230 | if err != nil { |
| 231 | logs.Errorf("can't get runtime %s from runner connection", runtimeID) |
| 232 | return |
| 233 | } |
| 234 | if err := rt.startRunnerLoop(&startRunnerParams{conn: conn, buf: buf}); err != nil { |
| 235 | logs.Errorf("init runner %s failed: %s", rt.RuntimeID, err.Error()) |
| 236 | } |
| 237 | } |
| 238 | |
| 239 | func (s *DispatchServerV2) StartRecvLog(runtimeID, requestID string, store LogStatStore) { |
| 240 | st := s.statsMap.get(runtimeID) |