@@ -408,7 +408,7 @@ func (s *httpServer) doPauseTopic(w http.ResponseWriter, req *http.Request, ps h
408
408
func (s * httpServer ) doDrainTopic (w http.ResponseWriter , req * http.Request , ps httprouter.Params ) (interface {}, error ) {
409
409
reqParams , err := http_api .NewReqParams (req )
410
410
if err != nil {
411
- s .ctx . nsqd .logf (LOG_ERROR , "failed to parse request params - %s" , err )
411
+ s .nsqd .logf (LOG_ERROR , "failed to parse request params - %s" , err )
412
412
return nil , http_api.Err {400 , "INVALID_REQUEST" }
413
413
}
414
414
@@ -417,14 +417,14 @@ func (s *httpServer) doDrainTopic(w http.ResponseWriter, req *http.Request, ps h
417
417
return nil , http_api.Err {400 , "MISSING_ARG_TOPIC" }
418
418
}
419
419
420
- topic , err := s .ctx . nsqd .GetExistingTopic (topicName )
420
+ topic , err := s .nsqd .GetExistingTopic (topicName )
421
421
if err != nil {
422
422
return nil , http_api.Err {404 , "TOPIC_NOT_FOUND" }
423
423
}
424
424
425
425
err = topic .StartDraining ()
426
426
if err != nil {
427
- s .ctx . nsqd .logf (LOG_ERROR , "failure in %s - %s" , req .URL .Path , err )
427
+ s .nsqd .logf (LOG_ERROR , "failure in %s - %s" , req .URL .Path , err )
428
428
return nil , http_api.Err {500 , "INTERNAL_ERROR" }
429
429
}
430
430
return nil , nil
@@ -775,7 +775,7 @@ func getOptByCfgName(opts interface{}, name string) (interface{}, bool) {
775
775
}
776
776
777
777
func (s * httpServer ) startDraining (w http.ResponseWriter , req * http.Request , ps httprouter.Params ) (interface {}, error ) {
778
- err := s .ctx . nsqd .StartDraining ()
778
+ err := s .nsqd .StartDraining ()
779
779
if err != nil {
780
780
return nil , http_api.Err {500 , "TODO" }
781
781
}
0 commit comments