github.com/mistwind/reviewdog@v0.0.0-20230322024206-9cfa11856d58/doghouse/appengine/warmup.go (about)

     1  package main
     2  
     3  import (
     4  	"net/http"
     5  
     6  	"github.com/vvakame/sdlog/aelog"
     7  
     8  	"github.com/mistwind/reviewdog/doghouse/server/ciutil"
     9  )
    10  
    11  func warmupHandler(_ http.ResponseWriter, r *http.Request) {
    12  	ctx := r.Context()
    13  	aelog.Infof(ctx, "warming up server...")
    14  
    15  	if err := ciutil.UpdateTravisCIIPAddrs(&http.Client{}); err != nil {
    16  		aelog.Errorf(ctx, "failed to update travis CI IP addresses: %v", err)
    17  	}
    18  
    19  	aelog.Infof(ctx, "warmup done")
    20  }