Skip to content
This repository has been archived by the owner on Oct 1, 2021. It is now read-only.

Commit

Permalink
chore(deps): bump github.com/ViBiOh/httputils/v3 from 3.36.5 to 3.37.1
Browse files Browse the repository at this point in the history
Bumps [github.com/ViBiOh/httputils/v3](https://github.com/ViBiOh/httputils) from 3.36.5 to 3.37.1.
- [Release notes](https://github.com/ViBiOh/httputils/releases)
- [Commits](ViBiOh/httputils@v3.36.5...v3.37.1)

Signed-off-by: dependabot[bot] <support@github.com>
  • Loading branch information
dependabot[bot] authored and ViBiOh committed Jan 24, 2021
1 parent 1c22b71 commit dc0675e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
5 changes: 3 additions & 2 deletions cmd/deploy/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ func main() {
annotationApp := annotation.New(annotationConfig)
apiApp := api.New(apiConfig, mailerApp, annotationApp)

go apiApp.Start()
server := httputils.New(serverConfig)
go apiApp.Start(server.GetDone())

httputils.New(serverConfig).ListenAndServe(apiApp.Handler(), nil, prometheus.New(prometheusConfig).Middleware, owasp.New(owaspConfig).Middleware)
server.ListenAndServe(apiApp.Handler(), nil, prometheus.New(prometheusConfig).Middleware, owasp.New(owaspConfig).Middleware)
}
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ module github.com/ViBiOh/deploy
go 1.15

require (
github.com/ViBiOh/httputils/v3 v3.36.5
github.com/ViBiOh/httputils/v3 v3.37.1
github.com/ViBiOh/mailer v1.12.0
golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4 // indirect
)
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWX
github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI=
github.com/ViBiOh/httputils/v3 v3.36.5 h1:SdhmLyZ0GGTyG+gpqJp3kl3bGz4Ci/q6snE67OicS7s=
github.com/ViBiOh/httputils/v3 v3.36.5/go.mod h1:l4sdVJfRu99dY7rNJfMinJHYb0pJZU9FEz7C83dX6gE=
github.com/ViBiOh/httputils/v3 v3.37.1 h1:TQU5DC20RttMASVzK88DYNonADdnJko/ri220d067VI=
github.com/ViBiOh/httputils/v3 v3.37.1/go.mod h1:ySOLanXZ/Ll0UGnBFZjLd0aTtf3eVQe56yurhkDeR1Q=
github.com/ViBiOh/mailer v1.12.0 h1:3UEuMIRdKMnnfEMykYwDgHKMPqdwOEtipZ/8zsFreE0=
github.com/ViBiOh/mailer v1.12.0/go.mod h1:OSSN8UMKQhjkZmp894MT+XPRmT2mQP8YcRgj8RwwwuI=
github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g=
Expand Down Expand Up @@ -271,7 +273,9 @@ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/tdewolff/minify/v2 v2.9.10/go.mod h1:U1Nc+/YBSB0FPEarqcgkYH3Ep4DNyyIbOyl5P4eWMuo=
github.com/tdewolff/minify/v2 v2.9.11/go.mod h1:YZk0lGOc6CvQrqvm5f7V3ihaq3QUd9acS4HESdVDOaM=
github.com/tdewolff/parse/v2 v2.5.5/go.mod h1:WzaJpRSbwq++EIQHYIRTpbYKNA3gn9it1Ik++q4zyho=
github.com/tdewolff/parse/v2 v2.5.8/go.mod h1:WzaJpRSbwq++EIQHYIRTpbYKNA3gn9it1Ik++q4zyho=
github.com/tdewolff/test v1.0.6/go.mod h1:6DAvZliBAAnD7rhVgwaM7DE5/d9NMOAJ09SqYqeK4QE=
github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
Expand Down
12 changes: 6 additions & 6 deletions pkg/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (

// App of package
type App interface {
Start()
Start(<-chan struct{})
Handler() http.Handler
}

Expand Down Expand Up @@ -75,8 +75,10 @@ func validateRequest(r *http.Request) (project string, err error) {
return
}

func (a app) Start() {
cron.New().Days().At("06:00").In("Europe/Paris").Start(func(_ time.Time) error {
func (a app) Start(done <-chan struct{}) {
cron.New().Days().At("06:00").In("Europe/Paris").OnError(func(err error) {
logger.Error("%s", err)
}).Start(func(_ time.Time) error {
cmd := exec.Command("./clean")

var out bytes.Buffer
Expand All @@ -87,9 +89,7 @@ func (a app) Start() {
logger.Info("%s", out.Bytes())

return err
}, func(err error) {
logger.Error("%s", err)
})
}, done)
}

// Handler for request. Should be use with net/http
Expand Down

0 comments on commit dc0675e

Please sign in to comment.