diff options
Diffstat (limited to 'backend/internal/monitor/worker.go')
| -rw-r--r-- | backend/internal/monitor/worker.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/backend/internal/monitor/worker.go b/backend/internal/monitor/worker.go index 70855a2..34a5cba 100644 --- a/backend/internal/monitor/worker.go +++ b/backend/internal/monitor/worker.go @@ -166,9 +166,16 @@ func (w *Worker) checkService(ctx context.Context, svc model.Service) { checkCtx, cancel := context.WithTimeout(ctx, w.timeout) defer cancel() - hb := CheckHTTP(checkCtx, svc.URL, svc.KeywordToFind) + hb, ssl := CheckHTTP(checkCtx, svc.URL, svc.KeywordToFind) hb.ServiceID = svc.ID + if ssl != nil { + ssl.ServiceID = svc.ID + if err := w.store.SaveSSLInfo(*ssl); err != nil { + log.Printf("[worker] erro ao salvar ssl info: %v", err) + } + } + w.results <- checkResult{Heartbeat: hb, Service: svc} } |