synk.ClientFromContext(ctx)
func (w *contractWorker) Work(ctx context.Context, job *synk.Job[ContractArgs]) error {
client := synk.ClientFromContext(ctx)
for _, id := range job.DependsOn {
client.Retry(ctx, &id)
}
random := time.Duration(rand.Intn(10))
if random < 3 {
return fmt.Errorf("error processing contract job: %s", job.Args.CustomerID)
}
time.Sleep(time.Second * random)
return nil
}