MM-52216: Trim errors (#23040)
https://mattermost.atlassian.net/browse/MM-52216 ```release-note NONE ```
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
041cbe2d24
Коммит
67735be261
@@ -233,3 +233,14 @@ func SanitizeDataSource(driverName, dataSource string) (string, error) {
|
||||
return "", errors.New("invalid drivername. Not postgres or mysql.")
|
||||
}
|
||||
}
|
||||
|
||||
const maxTokenSize = 50
|
||||
|
||||
// trimInput limits the string to a max size to prevent clogging up disk space
|
||||
// while logging
|
||||
func trimInput(input string) string {
|
||||
if len(input) > maxTokenSize {
|
||||
input = input[:maxTokenSize] + "..."
|
||||
}
|
||||
return input
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user