submitqueue: remove updateHEAD function
This is already done during the Run() function
This commit is contained in:
		
							parent
							
								
									266c27d1d0
								
							
						
					
					
						commit
						ad27d963f2
					
				
					 2 changed files with 0 additions and 24 deletions
				
			
		|  | @ -1,7 +1,6 @@ | |||
| package frontend | ||||
| 
 | ||||
| import ( | ||||
| 	"fmt" | ||||
| 	"io/ioutil" | ||||
| 	"net/http" | ||||
| 
 | ||||
|  | @ -61,23 +60,10 @@ func MakeFrontend(runner *submitqueue.Runner) *Frontend { | |||
| 	router.SetHTMLTemplate(tmpl) | ||||
| 
 | ||||
| 	router.GET("/submit-queue.json", func(c *gin.Context) { | ||||
| 
 | ||||
| 		// FIXME: do this periodically | ||||
| 		err := submitQueue.UpdateHEAD() | ||||
| 		if err != nil { | ||||
| 			c.AbortWithError(http.StatusBadGateway, fmt.Errorf("unable to update HEAD")) | ||||
| 		} | ||||
| 		c.JSON(http.StatusOK, submitQueue) | ||||
| 	}) | ||||
| 
 | ||||
| 	router.GET("/", func(c *gin.Context) { | ||||
| 		// FIXME: do this periodically | ||||
| 
 | ||||
| 		err := submitQueue.UpdateHEAD() | ||||
| 		if err != nil { | ||||
| 			c.AbortWithError(http.StatusBadGateway, fmt.Errorf("unable to update HEAD")) | ||||
| 		} | ||||
| 
 | ||||
| 		c.HTML(http.StatusOK, "submit-queue.tmpl.html", gin.H{ | ||||
| 			"series":      submitQueue.Series, | ||||
| 			"projectName": submitQueue.ProjectName, | ||||
|  |  | |||
|  | @ -53,16 +53,6 @@ func (s *SubmitQueue) LoadSeries(log *logrus.Logger) error { | |||
| 	return nil | ||||
| } | ||||
| 
 | ||||
| // UpdateHEAD updates the HEAD field with the commit ID of the current HEAD | ||||
| func (s *SubmitQueue) UpdateHEAD() error { | ||||
| 	HEAD, err := s.gerrit.GetHEAD(s.ProjectName, s.BranchName) | ||||
| 	if err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	s.HEAD = HEAD | ||||
| 	return nil | ||||
| } | ||||
| 
 | ||||
| // TODO: clear submit queue tag if missing +1/+2? | ||||
| 
 | ||||
| // IsAutoSubmittable returns true if a given Serie has all the necessary flags set | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue