1
0
Fork 0
mirror of https://github.com/arangodb/kube-arangodb.git synced 2024-12-14 11:57:37 +00:00

[Bugfix] Fix backup creation timeout (#952)

This commit is contained in:
Adam Janikowski 2022-04-12 15:31:04 +02:00 committed by GitHub
parent 627f6f729a
commit 30ea984f9d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View file

@ -3,6 +3,7 @@
## [master](https://github.com/arangodb/kube-arangodb/tree/master) (N/A)
- (Feature) Allow configuration for securityContext.runAsUser value
- (Bugfix) Fix Satellite collections in Agency
- (Bugfix) Fix backup creation timeout
## [1.2.9](https://github.com/arangodb/kube-arangodb/tree/1.2.9) (2022-03-30)
- (Feature) Improve Kubernetes clientsets management

View file

@ -75,8 +75,7 @@ func (ac *arangoClientBackupImpl) List() (map[driver.BackupID]driver.BackupMeta,
}
func (ac *arangoClientBackupImpl) Create() (ArangoBackupCreateResponse, error) {
ctx, cancel := context.WithTimeout(context.Background(), defaultArangoClientTimeout)
defer cancel()
dt := defaultArangoClientTimeout
co := driver.BackupCreateOptions{}
@ -86,9 +85,13 @@ func (ac *arangoClientBackupImpl) Create() (ArangoBackupCreateResponse, error) {
}
if timeout := opt.Timeout; timeout != nil {
co.Timeout = time.Duration(*timeout * float32(time.Second))
dt += co.Timeout
}
}
ctx, cancel := context.WithTimeout(context.Background(), dt)
defer cancel()
id, resp, err := ac.driver.Backup().Create(ctx, &co)
if err != nil {
return ArangoBackupCreateResponse{}, err