heartbeat updates the last seen at timestamp in the database. If HeartbeatFn is set, it will be called instead.
(ctx context.Context)
| 312 | // heartbeat updates the last seen at timestamp in the database. |
| 313 | // If HeartbeatFn is set, it will be called instead. |
| 314 | func (s *server) heartbeat(ctx context.Context) error { |
| 315 | select { |
| 316 | case <-ctx.Done(): |
| 317 | return nil |
| 318 | default: |
| 319 | return s.heartbeatFn(ctx) |
| 320 | } |
| 321 | } |
| 322 | |
| 323 | func (s *server) defaultHeartbeat(ctx context.Context) error { |
| 324 | //nolint:gocritic // This is specifically for updating the last seen at timestamp. |