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

Do not restore old backups when upgrade fails #110

Closed
wants to merge 3 commits into from
Closed

Conversation

dgdavid
Copy link
Member

@dgdavid dgdavid commented Sep 12, 2018

@coveralls
Copy link

Coverage Status

Coverage increased (+0.1%) to 18.49% when pulling 58f3339 on fix/bsc-1097297 into aff448e on master.

Copy link
Member

@lslezak lslezak left a comment

Choose a reason for hiding this comment

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

Minor improvements

log.info "Restoring with script #{cmd} result: #{res}"
backup_time = File.stat(path).ctime.to_i

if boot_time < backup_time
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure if this works on platforms without RTC (e.g. Raspberry Pi). If without RTC the boot time is always 0 then the backup would be always restored. We should check that.

@@ -850,6 +859,11 @@ def restore_backup

private

# @return [Integer] boot time found in /proc/stat
def boot_time
@boot_time ||= IO.read("/proc/stat")[/btime.*/].split.last.to_i
Copy link
Member

Choose a reason for hiding this comment

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

It would be nice to add a test for parsing the file, the added test mocks the method completely so it's skipped.

@dgdavid
Copy link
Member Author

dgdavid commented Sep 17, 2018

Closed in favor of #111

@dgdavid dgdavid closed this Sep 17, 2018
@dgdavid dgdavid deleted the fix/bsc-1097297 branch September 17, 2018 13:00
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