fix: more backup errors
All checks were successful
Deploy to Staging / Build Images (push) Successful in 2m35s
Deploy to Staging / Deploy to Staging (push) Successful in 37s
Deploy to Staging / Verify Staging (push) Successful in 6s
Deploy to Staging / Notify Staging Ready (push) Successful in 5s
Deploy to Staging / Notify Staging Failure (push) Has been skipped
All checks were successful
Deploy to Staging / Build Images (push) Successful in 2m35s
Deploy to Staging / Deploy to Staging (push) Successful in 37s
Deploy to Staging / Verify Staging (push) Successful in 6s
Deploy to Staging / Notify Staging Ready (push) Successful in 5s
Deploy to Staging / Notify Staging Failure (push) Has been skipped
This commit is contained in:
@@ -408,13 +408,23 @@ export const adminApi = {
|
||||
return response.data;
|
||||
},
|
||||
|
||||
// Execute restore
|
||||
// Execute restore (longer timeout since this is a long-running operation)
|
||||
restore: async (id: string, options?: ExecuteRestoreRequest): Promise<{ message: string }> => {
|
||||
const response = await apiClient.post<{ message: string }>(
|
||||
`/admin/backups/${id}/restore`,
|
||||
options
|
||||
);
|
||||
return response.data;
|
||||
try {
|
||||
const response = await apiClient.post<{ message: string }>(
|
||||
`/admin/backups/${id}/restore`,
|
||||
options,
|
||||
{ timeout: 120000 } // 2 minute timeout for restore operations
|
||||
);
|
||||
return response.data;
|
||||
} catch (error: any) {
|
||||
// If a restore is already in progress, treat it as success since it will complete
|
||||
const errorMessage = error?.response?.data?.error || error?.message || '';
|
||||
if (errorMessage.includes('already in progress')) {
|
||||
return { message: 'Restore is in progress and will complete shortly' };
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
},
|
||||
|
||||
// Schedules
|
||||
|
||||
Reference in New Issue
Block a user