fmsg: drop messages when msgbuf is full during withhold
All checks were successful
test / test (push) Successful in 20s
All checks were successful
test / test (push) Successful in 20s
Logging functions are not expected to block. This change fixes multiple hangs where more than 64 messages are produced during withhold. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
This commit is contained in:
@@ -16,20 +16,17 @@ func SetPrefix(prefix string) {
|
||||
|
||||
func Print(v ...any) {
|
||||
dequeueOnce.Do(dequeue)
|
||||
queueSync.Add(1)
|
||||
msgbuf <- dPrint(v)
|
||||
queue(dPrint(v))
|
||||
}
|
||||
|
||||
func Printf(format string, v ...any) {
|
||||
dequeueOnce.Do(dequeue)
|
||||
queueSync.Add(1)
|
||||
msgbuf <- &dPrintf{format, v}
|
||||
queue(&dPrintf{format, v})
|
||||
}
|
||||
|
||||
func Println(v ...any) {
|
||||
dequeueOnce.Do(dequeue)
|
||||
queueSync.Add(1)
|
||||
msgbuf <- dPrintln(v)
|
||||
queue(dPrintln(v))
|
||||
}
|
||||
|
||||
func Fatal(v ...any) {
|
||||
|
||||
Reference in New Issue
Block a user