Skip to content

Commit

Permalink
Remove time from commitlog open fn
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard Artoul committed Jan 12, 2019
1 parent 6c86012 commit d719816
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/dbnode/persist/fs/commitlog/commit_log.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ func (l *commitLog) Open() error {
defer l.closedState.Unlock()

// Open the buffered commit log writer
if _, err := l.openWriter(l.nowFn()); err != nil {
if _, err := l.openWriter(); err != nil {
return err
}

Expand Down Expand Up @@ -429,8 +429,7 @@ func (l *commitLog) write() {

isRotateLogsEvent := write.eventType == rotateLogsEventType
if isRotateLogsEvent {
now := l.nowFn()
file, err := l.openWriter(now)
file, err := l.openWriter()
if err != nil {
l.metrics.errors.Inc(1)
l.metrics.openErrors.Inc(1)
Expand Down Expand Up @@ -539,7 +538,7 @@ func (l *commitLog) onFlush(err error) {
}

// writerState lock must be held for the duration of this function call.
func (l *commitLog) openWriter(now time.Time) (persist.CommitlogFile, error) {
func (l *commitLog) openWriter() (persist.CommitlogFile, error) {
if l.writerState.writer != nil {
if err := l.writerState.writer.Close(); err != nil {
l.metrics.closeErrors.Inc(1)
Expand Down

0 comments on commit d719816

Please sign in to comment.