Skip to content

Commit

Permalink
chore(deps): Bumping deps
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Boutour <[email protected]>
  • Loading branch information
ViBiOh committed Oct 22, 2023
1 parent fd085ba commit 24adfc2
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 60 deletions.
2 changes: 1 addition & 1 deletion cmd/fibr/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func newClient(ctx context.Context, config configuration) (client, error) {

request.AddOpenTelemetryToDefaultClient(output.telemetry.MeterProvider(), output.telemetry.TracerProvider())

output.health = health.New(config.health)
output.health = health.New(ctx, config.health)

output.redis, err = redis.New(config.redis, output.telemetry.MeterProvider(), output.telemetry.TracerProvider())
if err != nil {
Expand Down
24 changes: 16 additions & 8 deletions cmd/fibr/fibr.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ import (
basicMemory "github.com/ViBiOh/auth/v2/pkg/store/memory"
"github.com/ViBiOh/fibr/pkg/provider"
"github.com/ViBiOh/httputils/v4/pkg/alcotest"
"github.com/ViBiOh/httputils/v4/pkg/httputils"
"github.com/ViBiOh/httputils/v4/pkg/owasp"
"github.com/ViBiOh/httputils/v4/pkg/recoverer"
"github.com/ViBiOh/httputils/v4/pkg/server"
"go.opentelemetry.io/otel/trace"
)

Expand Down Expand Up @@ -61,28 +65,32 @@ func main() {
os.Exit(1)
}

endCtx := clients.health.End(ctx)
endCtx := clients.health.EndCtx()

services, err := newServices(endCtx, config, clients, adapters)
if err != nil {
slog.Error("services", "err", err)
os.Exit(1)
}

ports := newPorts(config, clients, services)

stopOnDone := Starters{services.amqpThumbnail, services.amqpExif, services.sanitizer}
stopOnDone.Start(clients.health.Done(ctx))
stopOnDone.Start(clients.health.DoneCtx())
defer stopOnDone.GracefulWait()

stopOnEnd := Starters{services.webhook, services.share}
stopOnEnd.Start(endCtx)
defer stopOnEnd.GracefulWait()

ports.Start(endCtx)
defer ports.GracefulWait()

go adapters.eventBus.Start(endCtx, adapters.storage, []provider.Renamer{services.thumbnail.Rename, services.metadata.Rename}, services.share.EventConsumer, services.thumbnail.EventConsumer, services.metadata.EventConsumer, services.webhook.EventConsumer)

clients.health.WaitForTermination(ports.TerminateOnDone())
appServer := server.New(config.appServer)

go appServer.Start(endCtx, "http", httputils.Handler(
services.renderer.Handler(services.fibr.TemplateFunc),
clients.health, recoverer.Middleware, clients.telemetry.Middleware("http"), owasp.New(config.owasp).Middleware,
))

clients.health.WaitForTermination(appServer.Done())

appServer.Stop(ctx)
}
48 changes: 0 additions & 48 deletions cmd/fibr/port.go

This file was deleted.

2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require (
github.com/ViBiOh/auth/v2 v2.16.1
github.com/ViBiOh/exas v0.7.1
github.com/ViBiOh/flags v1.4.1
github.com/ViBiOh/httputils/v4 v4.66.9
github.com/ViBiOh/httputils/v4 v4.67.1
github.com/ViBiOh/vith v0.6.0
github.com/rabbitmq/amqp091-go v1.9.0
github.com/redis/go-redis/v9 v9.2.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ github.com/ViBiOh/exas v0.7.1 h1:nzh6E1668OFRgoTIJZJa1RybCW64Gd918qi0Z+0Q4WA=
github.com/ViBiOh/exas v0.7.1/go.mod h1:MvIWQZXpWgg45Vsde9bMV48Kb0J8frya8vimmrkQ04E=
github.com/ViBiOh/flags v1.4.1 h1:qEAO70rWTYcVlU9BgCuz0SgMjth12oi502cq3SHDudg=
github.com/ViBiOh/flags v1.4.1/go.mod h1:Ocgx/QhY7WYNfGokFT3kw5C05pDooQyLbI/9ZWwylI4=
github.com/ViBiOh/httputils/v4 v4.66.9 h1:iPb6PYaYClgiB39xdo/SeKkbai46AyuqGYfmHyHuZuc=
github.com/ViBiOh/httputils/v4 v4.66.9/go.mod h1:7KTWHkVw50L+UG7XHK9mtPQpTHMPdDyWV0MY+cCNpqw=
github.com/ViBiOh/httputils/v4 v4.67.1 h1:hpyU4dv6sfrN5T+ImMXfTz6soXCLb+7rusIL7sxaCGU=
github.com/ViBiOh/httputils/v4 v4.67.1/go.mod h1:7KTWHkVw50L+UG7XHK9mtPQpTHMPdDyWV0MY+cCNpqw=
github.com/ViBiOh/vith v0.6.0 h1:bdLmwgqUEWi3ivShtAhtM9gOZlWQzvZi2Z5b0BRSB1U=
github.com/ViBiOh/vith v0.6.0/go.mod h1:eRqtDU2uB8g85vll4spbnCV93DHyHNAYwXCMIBH1GuQ=
github.com/bsm/ginkgo/v2 v2.7.0/go.mod h1:AiKlXPm7ItEHNc/2+OkrNG4E0ITzojb9/xWzvQ9XZ9w=
Expand Down

0 comments on commit 24adfc2

Please sign in to comment.