|
@@ -39,8 +39,8 @@ func (h *MyEventHandler) OnRow(e *canal.RowsEvent) (err error) {
|
|
|
fmt.Println("fileName:", h.fileName, ";position:", h.position)
|
|
|
|
|
|
// 每次操作完成后都将当前位置记录到缓存
|
|
|
- global.Rc.Put(utils.CACHE_MYSQL_MASTER_FILENAME, h.fileName, 24*time.Hour)
|
|
|
- global.Rc.Put(utils.CACHE_MYSQL_MASTER_POSITION, h.position, 24*time.Hour)
|
|
|
+ global.Rc.Put(utils.CACHE_MYSQL_MASTER_FILENAME, h.fileName, 31*24*time.Hour)
|
|
|
+ global.Rc.Put(utils.CACHE_MYSQL_MASTER_POSITION, h.position, 31*24*time.Hour)
|
|
|
|
|
|
return nil
|
|
|
}
|
|
@@ -50,8 +50,8 @@ func (h *MyEventHandler) OnPosSynced(header *replication.EventHeader, p mysql.Po
|
|
|
h.position = p.Pos
|
|
|
|
|
|
// 旋转binlog日志的时候,需要将当前位置记录到缓存
|
|
|
- global.Rc.Put(utils.CACHE_MYSQL_MASTER_FILENAME, h.fileName, 24*time.Hour)
|
|
|
- global.Rc.Put(utils.CACHE_MYSQL_MASTER_POSITION, h.position, 24*time.Hour)
|
|
|
+ global.Rc.Put(utils.CACHE_MYSQL_MASTER_FILENAME, h.fileName, 31*24*time.Hour)
|
|
|
+ global.Rc.Put(utils.CACHE_MYSQL_MASTER_POSITION, h.position, 31*24*time.Hour)
|
|
|
|
|
|
return nil
|
|
|
}
|