@@ -108,6 +108,10 @@ public function __construct(
108
108
public function nextBackups (): array {
109
109
$ partialETA = $ fullETA = -1 ;
110
110
111
+ $ delayPartial = $ this ->configService ->getAppValueInt (ConfigService::DELAY_PARTIAL_RP );
112
+ $ delayUnit = $ this ->configService ->getAppValue (ConfigService::DELAY_UNIT );
113
+ $ delayPartial = $ delayPartial * 3600 * (($ delayUnit !== 'h ' ) ? 24 : 1 );
114
+
111
115
try {
112
116
$ this ->getTime ();
113
117
$ time = time () - 3600 ; // we start checking now.
@@ -116,12 +120,16 @@ public function nextBackups(): array {
116
120
if (!$ this ->verifyTime ($ time )) {
117
121
continue ;
118
122
}
123
+
124
+ $ last = max ($ fullETA , $ this ->configService ->getAppValueInt (ConfigService::DATE_FULL_RP ));
125
+
126
+ // TODO: minor glitch: this will estimate the partial backup with one hour late.
119
127
if ($ fullETA === -1 && $ this ->verifyFullBackup ($ time )) {
120
128
$ fullETA = $ time ;
121
129
} elseif ($ partialETA === -1
122
130
&& $ this ->verifyIncrementalBackup ($ time )
123
- && ($ this -> configService -> getAppValueInt (ConfigService:: DATE_FULL_RP ) > 0
124
- || $ fullETA > 0 )) { // we check that the incremental backup can have a parent
131
+ && ($ last > 0 ) // we check that the incremental backup can have a parent
132
+ && ( $ time - $ last ) > $ delayPartial ) { // we check the time since next full rp
125
133
$ partialETA = $ time ;
126
134
}
127
135
@@ -133,8 +141,8 @@ public function nextBackups(): array {
133
141
}
134
142
135
143
return [
136
- 'partial ' => $ partialETA ,
137
- 'full ' => $ fullETA
144
+ 'partial ' => $ partialETA + 300 ,
145
+ 'full ' => $ fullETA + 300
138
146
];
139
147
}
140
148
0 commit comments