Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added: continuing from the last read position #4

Merged
merged 3 commits into from
Aug 24, 2023
Merged

added: continuing from the last read position #4

merged 3 commits into from
Aug 24, 2023

Conversation

aarthikrao
Copy link
Owner

No description provided.

maxLogSize: opts.MaxLogSize,
logSize: fi.Size(),
// If the list of files is empty, the directory is empty
return len(fileList) == 0, nil
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per documentation Incase of empty fileList, readdir would return non nil error also, therefore we should check for io.eof error as well.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added the exception for EOF in the check above. Here, if the error is EOF, the fileList will be empty by default. So this logic should work. Let me know if you find otherwise.

wal.go Outdated Show resolved Hide resolved
@aarthikrao aarthikrao merged commit 43d71f1 into main Aug 24, 2023
1 check passed
@aarthikrao aarthikrao deleted the lastRead branch August 24, 2023 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants