mirror of
https://github.com/alibaba/canal.git
synced 2026-11-04 00:30:15 +08:00
meta.dat文件数据丢失 (#4397)
This commit is contained in:
@@ -209,7 +209,11 @@ public class FileMixedMetaManager extends MemoryMetaManager implements CanalMeta
|
||||
|
||||
data.setClientDatas(clientDatas);
|
||||
}
|
||||
|
||||
//fixed issue https://github.com/alibaba/canal/issues/4312
|
||||
//客户端数据为空时不覆盖文件内容 (适合单客户端)
|
||||
if(data.getClientDatas().isEmpty()){
|
||||
return;
|
||||
}
|
||||
String json = JsonUtils.marshalToString(data);
|
||||
try {
|
||||
FileUtils.writeStringToFile(dataFile, json);
|
||||
|
||||
Reference in New Issue
Block a user