Skip to content

Commit

Permalink
doc(main): Updated documentation (#269)
Browse files Browse the repository at this point in the history
  • Loading branch information
ekkinox authored Jul 17, 2024
1 parent 410e641 commit c61f160
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions docs/modules/fxworker.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,32 @@ You can get, in real time, the status of your workers executions on the [core](f
![](../../assets/images/dash-workers-light.png#only-light)
![](../../assets/images/dash-workers-dark.png#only-dark)

## Health Check

This module provides a ready to use [WorkerProbe](https://github.com/ankorstore/yokai/blob/main/worker/healthcheck/probe.go), to be used by the [health check](fxhealthcheck.md) module.

It will ensure that the worker pool executions are all in healthy status.

You just need to register it:

```go title="internal/register.go"
package internal

import (
"github.com/ankorstore/yokai/fxhealthcheck"
"github.com/ankorstore/yokai/worker/healthcheck"
"go.uber.org/fx"
)

func Register() fx.Option {
return fx.Options(
// register the WorkerProbe probe for startup, liveness and readiness checks
fxhealthcheck.AsCheckerProbe(healthcheck.NewWorkerProbe),
// ...
)
}
```

## Logging

To get logs correlation in your workers, you need to retrieve the logger from the context with `log.CtxLogger()`:
Expand Down

0 comments on commit c61f160

Please sign in to comment.