mirror of
https://github.com/hibiken/asynqmon.git
synced 2025-09-22 06:46:34 +08:00
Truncate payload printed in the UI
Added a flag --max-payload-length to allow customizing the value
This commit is contained in:
@@ -27,7 +27,10 @@ func (f PayloadFormatterFunc) FormatPayload(taskType string, payload []byte) str
|
||||
return f(taskType, payload)
|
||||
}
|
||||
|
||||
var defaultPayloadFormatter = PayloadFormatterFunc(func(_ string, payload []byte) string {
|
||||
// DefaultPayloadFormatter is the PayloadFormater used by default.
|
||||
// It prints the given payload bytes as is if the bytes are printable, otherwise it prints a message to indicate
|
||||
// that the bytes are not printable.
|
||||
var DefaultPayloadFormatter = PayloadFormatterFunc(func(_ string, payload []byte) string {
|
||||
if !isPrintable(payload) {
|
||||
return "non-printable bytes"
|
||||
}
|
||||
|
Reference in New Issue
Block a user