mirror of
https://github.com/minio/minio.git
synced 2025-03-03 15:20:08 -05:00
audit: Try to send audit even if the status is offline (#18458)
Currently, once the audit becomes offline, there is no code that tries to reconnect to the audit, at the same time Send() quickly returns with an error without really trying to send a message the audit endpoint; so the audit endpoint will never be online again. Fixing this behavior; the current downside is that we miss printing some logs when the audit becomes offline; however this information is available in prometheus Later, we can refactor internal/logger so the http endpoint can send errors to console target.
This commit is contained in:
parent
e4b619ce1a
commit
12f570a307
@ -379,10 +379,6 @@ func (h *Target) SendFromStore(key store.Key) (err error) {
|
|||||||
// Messages are queued in the disk if the store is enabled
|
// Messages are queued in the disk if the store is enabled
|
||||||
// If Cancel has been called the message is ignored.
|
// If Cancel has been called the message is ignored.
|
||||||
func (h *Target) Send(ctx context.Context, entry interface{}) error {
|
func (h *Target) Send(ctx context.Context, entry interface{}) error {
|
||||||
if atomic.LoadInt32(&h.status) == statusOffline {
|
|
||||||
h.config.LogOnce(ctx, fmt.Errorf("target %s is offline", h.Endpoint()), h.Endpoint())
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
if atomic.LoadInt32(&h.status) == statusClosed {
|
if atomic.LoadInt32(&h.status) == statusClosed {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user