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

Save current state before exit (fix wrong refunds on restart) #73

Closed
wants to merge 2 commits into from
Closed

Save current state before exit (fix wrong refunds on restart) #73

wants to merge 2 commits into from

Conversation

chhantyal
Copy link
Contributor

This is related to #68 & fixes wrong refunds being issued after process restart.

I got bitten by this bug on https://steemit.com/@noicebot/transfers, during last 10 days it refunded many users twice. Problem seems to be that when process is killed/restarted, state.json isn't saved.

Thus, I think it's good idea to save current state before bot is stopped. This works when it is gracefully closed eg. Ctl + C, kill etc (but not when doing force quit)

I also had to change to fs.writeFileSync otherwise process exits before write is complete.

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.

1 participant