https://mattermost.atlassian.net/browse/MM-40676

```release-note
NONE
```
Этот коммит содержится в:
Agniva De Sarker
2022-02-09 23:05:16 +05:30
коммит произвёл GitHub
родитель 440790dad6
Коммит 57eafbc6ca
322 изменённых файлов: 24889 добавлений и 14797 удалений

2
vendor/github.com/rudderlabs/analytics-go/License.md сгенерированный поставляемый
Просмотреть файл

@@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2016 Segment, Inc.
Copyright (c) 2019 RudderStack.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

4
vendor/github.com/rudderlabs/analytics-go/analytics.go сгенерированный поставляемый
Просмотреть файл

@@ -537,7 +537,7 @@ func (c *client) push(q *messageQueue, m Message, wg *sync.WaitGroup, ex *execut
var msg message
var err error
if msg, err = makeMessage(m, maxMessageBytes); err != nil {
if msg, err = makeMessage(m, c.MaxMessageBytes); err != nil {
c.errorf("%s - %v", err, m)
c.notifyFailure([]message{{m, nil}}, err)
return
@@ -578,7 +578,7 @@ func (c *client) maxBatchBytes() int {
SentAt: c.now(),
Context: c.DefaultContext,
})
return maxBatchBytes - len(b)
return c.MaxBatchBytes - len(b)
}
func (c *client) notifySuccess(msgs []message) {

30
vendor/github.com/rudderlabs/analytics-go/config.go сгенерированный поставляемый
Просмотреть файл

@@ -82,6 +82,12 @@ type Config struct {
//This variable will disable checking for the cluster-info end point and
//split the payload at node level for multi node setup
NoProxySupport bool
// Maximum bytes in a message
MaxMessageBytes int
// Maximum bytes in a batch
MaxBatchBytes int
}
// This constant sets the default endpoint to which client instances send
@@ -116,6 +122,22 @@ func (c *Config) validate() error {
}
}
if c.MaxMessageBytes < 0 {
return ConfigError{
Reason: "negetive value is not supported for MaxMessageBytes",
Field: "MaxMessageBytes",
Value: c.MaxMessageBytes,
}
}
if c.MaxBatchBytes < 0 {
return ConfigError{
Reason: "negetive value is not supported for MaxBatchBytes",
Field: "MaxBatchBytes",
Value: c.MaxBatchBytes,
}
}
return nil
}
@@ -162,6 +184,14 @@ func makeConfig(c Config) Config {
c.maxConcurrentRequests = 1000
}
if c.MaxMessageBytes == 0 {
c.MaxMessageBytes = defMaxMessageBytes
}
if c.MaxBatchBytes == 0 {
c.MaxBatchBytes = defMaxBatchBytes
}
// We always overwrite the 'library' field of the default context set on the
// client because we want this information to be accurate.
c.DefaultContext.Library = LibraryInfo{

4
vendor/github.com/rudderlabs/analytics-go/message.go сгенерированный поставляемый
Просмотреть файл

@@ -126,6 +126,6 @@ func (q *messageQueue) flush() (msgs []message) {
}
const (
maxBatchBytes = 500000
maxMessageBytes = 32000
defMaxBatchBytes = 500000 // ~500 KB
defMaxMessageBytes = 32000 // ~32 KB
)