Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Cliffstone
Copy link
Contributor

@Cliffstone Cliffstone commented Mar 6, 2024

Description:
This pull request introduces a flag, -persist-events, to moroz to addresses the issue of high directory creation and possible inode shortage in some cases along with increased memory usage.

Changes:
Added flPersistEvents field to SantaService struct in moroz/service.go.
Updated all references to SantaService to include the new flPersistEvents field.
Modified related functions and methods to accommodate the new flPersistEvents field.

Impact:
This change allows us to control whether events should be persisted, providing more flexibility for the user. The default value is set to true.

Testing:
Tested locally and successfully stopped writing to disk by when set to false.
./moroz -configs="./configs" -event-dir="./logs" -persist-events="false"

Cliffstone and others added 4 commits March 5, 2024 16:22
default value set to true
updated the flPersistEvents default value to true and fixed the description text
Added flPersistEvents flag to disable writing events to disk
-event-logfile string
path to file for saving uploaded events (default "/tmp/santa_events")
-persist-events
Enable writing events to disk (default `true`)
Copy link
Contributor

Choose a reason for hiding this comment

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

The PR description says the default value is set to false but it's true here. I think leaving the default set to true makes sense and ensures we won't break others when they upgrade.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry about that, I forgot to change the PR description. I agree with you on setting the default to true.

Do you feel that -persist-events is descriptive enough? I did struggle with finding a suitable name for the flag, this was the best I could come up with.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah, I think it's fine. Easy change later if needed!

@brandonfriess-stripe
Copy link
Contributor

Thanks for adding!

@bfreezy bfreezy merged commit 1c1f511 into groob:master Mar 8, 2024
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.

3 participants