@@ -587,34 +587,38 @@ class DumpRestoreHelper extends trs.runLocalInArangoshRunner {
587
587
}
588
588
589
589
restoreHotBackup ( ) {
590
- this . print ( "restoring backup - start" ) ;
591
- db . _useDatabase ( '_system' ) ;
592
- let list = this . listHotBackup ( ) ;
593
- let backupName ;
594
- Object . keys ( list ) . forEach ( function ( name , i ) {
595
- if ( name . search ( "testHotBackup" ) !== - 1 ) {
596
- backupName = name ;
590
+ let first = true ;
591
+ while ( first || this . options . loopEternal ) {
592
+ this . print ( "restoring backup - start" ) ;
593
+ first = false ;
594
+ db . _useDatabase ( '_system' ) ;
595
+ let list = this . listHotBackup ( ) ;
596
+ let backupName ;
597
+ Object . keys ( list ) . forEach ( function ( name , i ) {
598
+ if ( name . search ( "testHotBackup" ) !== - 1 ) {
599
+ backupName = name ;
600
+ }
601
+ } ) ;
602
+ if ( backupName === undefined ) {
603
+ this . print ( "didn't find a backup matching our pattern!" ) ;
604
+ this . results . restoreHotBackup = { status : false } ;
605
+ return false ;
597
606
}
598
- } ) ;
599
- if ( backupName === undefined ) {
600
- this . print ( "didn't find a backup matching our pattern!" ) ;
601
- this . results . restoreHotBackup = { status : false } ;
602
- return false ;
603
- }
604
- if ( ! list [ backupName ] . hasOwnProperty ( "keys" ) ||
605
- list [ backupName ] . keys [ 0 ] . sha256 !== encryptionKeySha256 ) {
606
- this . print ( "didn't find a backup having correct encryption keys!" ) ;
607
- this . print ( JSON . stringify ( list ) ) ;
608
- this . results . restoreHotBackup = { status : false } ;
609
- return false ;
607
+ if ( ! list [ backupName ] . hasOwnProperty ( "keys" ) ||
608
+ list [ backupName ] . keys [ 0 ] . sha256 !== encryptionKeySha256 ) {
609
+ this . print ( "didn't find a backup having correct encryption keys!" ) ;
610
+ this . print ( JSON . stringify ( list ) ) ;
611
+ this . results . restoreHotBackup = { status : false } ;
612
+ return false ;
613
+ }
614
+ this . print ( "restoring backup" ) ;
615
+ let cmds = {
616
+ "identifier" : backupName ,
617
+ "max-wait-for-restart" : 100.0
618
+ } ;
619
+ this . results . restoreHotBackup = ct . run . arangoBackup ( this . firstRunOptions , this . instanceManager , "restore" , cmds , this . instanceManager . rootDir , true ) ;
620
+ this . print ( "done restoring backup" ) ;
610
621
}
611
- this . print ( "restoring backup" ) ;
612
- let cmds = {
613
- "identifier" : backupName ,
614
- "max-wait-for-restart" : 100.0
615
- } ;
616
- this . results . restoreHotBackup = ct . run . arangoBackup ( this . firstRunOptions , this . instanceManager , "restore" , cmds , this . instanceManager . rootDir , true ) ;
617
- this . print ( "done restoring backup" ) ;
618
622
return true ;
619
623
}
620
624
0 commit comments