Skip to content

Commit c61f160

Browse files
authored
doc(main): Updated documentation (#269)
1 parent 410e641 commit c61f160

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

docs/modules/fxworker.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,32 @@ You can get, in real time, the status of your workers executions on the [core](f
164164
![](../../assets/images/dash-workers-light.png#only-light)
165165
![](../../assets/images/dash-workers-dark.png#only-dark)
166166

167+
## Health Check
168+
169+
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.
170+
171+
It will ensure that the worker pool executions are all in healthy status.
172+
173+
You just need to register it:
174+
175+
```go title="internal/register.go"
176+
package internal
177+
178+
import (
179+
"github.com/ankorstore/yokai/fxhealthcheck"
180+
"github.com/ankorstore/yokai/worker/healthcheck"
181+
"go.uber.org/fx"
182+
)
183+
184+
func Register() fx.Option {
185+
return fx.Options(
186+
// register the WorkerProbe probe for startup, liveness and readiness checks
187+
fxhealthcheck.AsCheckerProbe(healthcheck.NewWorkerProbe),
188+
// ...
189+
)
190+
}
191+
```
192+
167193
## Logging
168194

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

0 commit comments

Comments
 (0)