Skip to content

Commit 54cc110

Browse files
authored
export EventCacheCount on Canal Config (#913)
1 parent d67df91 commit 54cc110

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

canal/canal.go

+1
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,7 @@ func (c *Canal) prepareSyncer() error {
462462
Logger: c.cfg.Logger,
463463
Dialer: c.cfg.Dialer,
464464
Localhost: c.cfg.Localhost,
465+
EventCacheCount: c.cfg.EventCacheCount,
465466
RowsEventDecodeFunc: func(event *replication.RowsEvent, data []byte) error {
466467
pos, err := event.DecodeHeader(data)
467468
if err != nil {

canal/config.go

+5
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,11 @@ type Config struct {
107107

108108
// Set Localhost
109109
Localhost string
110+
111+
// EventCacheCount is the capacity of the BinlogStreamer internal event channel.
112+
// the default value is 10240.
113+
// if you table contain large columns, you can decrease this value to avoid OOM.
114+
EventCacheCount int
110115
}
111116

112117
func NewConfigWithFile(name string) (*Config, error) {

0 commit comments

Comments
 (0)