-
Notifications
You must be signed in to change notification settings - Fork 24
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
Add the backups-create command #452
Conversation
03446cc
to
a288f08
Compare
79ab6c8
to
ac0bf49
Compare
db/backup_create.go
Outdated
return err | ||
} | ||
|
||
io.Status("Successfully ordered to make a backup") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice if we could follow the backup progression.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well actually it was not really well designed. The backend should have returned 202
and an operation URL in the Location
header. Then we could have follow the process... ^^
That being said I can add a backups-show
command and update the status message to state:
Successfully scheduled a new backup. Type "scalingo backups-show backup-id" to follow the progress
If it's what you want, I would prefer to do it in a separate PR. OK?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for !backup.IsFinished() {
spinner.Lock()
if backup.Status == types.BackupStatusScheduled {
spinner.Suffix = " Waiting for the backup to start"
} else {
spinner.Suffix = " Waiting for the backup to finish"
}
spinner.Unlock()
time.Sleep(1 * time.Second)
backup, err = client.BackupGet(dbId, backup.ID.Hex())
if err != nil {
return errors.Wrap(err, "Fail to refresh backup state")
}
}
This is what i did for the db-cli. I think that this might be enough no ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean BackupGet
or GetBackup
? 😆
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But yes, good idea!
What a good idea 😻 |
@johnsudaar @EtienneM FYI this broke one of our scripts that was using the
|
@jonathanperret The issue has been fixed an a new bugfix release (v1.15.1) has been released. Sorry for the inconvenience. |
Wait for Scalingo/go-scalingo#116 to be mergedmerged!Wait for #449 to be mergedmerged!Wait for Scalingo/go-scalingo#115 to be mergedmerged!Fix #450