Files
bssapp/svc/internal/auditlog/writer.go
2026-02-11 17:46:22 +03:00

26 lines
408 B
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package auditlog
import "context"
func Write(log ActivityLog) {
if logQueue == nil {
return // sistem henüz init edilmediyse sessizce çık
}
select {
case logQueue <- log:
// kuyruğa alındı
default:
// kuyruk dolu → drop edilir, ana akış bozulmaz
}
}
func Enqueue(ctx context.Context, al ActivityLog) {
select {
case logQueue <- al:
// ok
default:
// queue dolu → drop
}
}