Skip to content

Commit 137d20d

Browse files
committed
Only emit rotate events when the binlog file has actually changed.
1 parent cf720bf commit 137d20d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,9 @@ ZongJi.prototype.start = function (options = {}) {
253253
case 'Rotate':
254254
if (this.options.filename !== event.binlogName) {
255255
this.options.filename = event.binlogName;
256+
this.emit('binlog', event);
256257
}
257-
break;
258+
return;
258259
}
259260
this.options.position = event.nextPosition;
260261
this.emit('binlog', event);

0 commit comments

Comments
 (0)