Skip to content

Commit

Permalink
export EventCacheCount on Canal Config (#913)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomwei7 authored Sep 4, 2024
1 parent d67df91 commit 54cc110
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions canal/canal.go
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,7 @@ func (c *Canal) prepareSyncer() error {
Logger: c.cfg.Logger,
Dialer: c.cfg.Dialer,
Localhost: c.cfg.Localhost,
EventCacheCount: c.cfg.EventCacheCount,
RowsEventDecodeFunc: func(event *replication.RowsEvent, data []byte) error {
pos, err := event.DecodeHeader(data)
if err != nil {
Expand Down
5 changes: 5 additions & 0 deletions canal/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ type Config struct {

// Set Localhost
Localhost string

// EventCacheCount is the capacity of the BinlogStreamer internal event channel.
// the default value is 10240.
// if you table contain large columns, you can decrease this value to avoid OOM.
EventCacheCount int
}

func NewConfigWithFile(name string) (*Config, error) {
Expand Down

0 comments on commit 54cc110

Please sign in to comment.