error in health polling fixed
This commit is contained in:
@@ -69,7 +69,7 @@ async function checkZvolAccess() {
|
||||
|
||||
async function checkResticRepository() {
|
||||
try {
|
||||
const result = await runRestic(['snapshots', '--json'], { ignoreExitCode: true });
|
||||
const result = await runRestic(['--no-lock', 'snapshots', '--json'], { ignoreExitCode: true });
|
||||
return checkValue(result.exitCode === 0, result.exitCode === 0 ? 'ok' : result.stderr.trim() || 'restic repository check failed');
|
||||
} catch (error) {
|
||||
return checkValue(false, error.message);
|
||||
|
||||
@@ -16,7 +16,7 @@ snapshotsRouter.get('/:vmName/:snapshotId/files', async (req, res, next) => {
|
||||
try {
|
||||
const snapshot = await validateSnapshotForVm(req.params.vmName, req.params.snapshotId);
|
||||
assertSnapshotIdShape(snapshot.id);
|
||||
const result = await runRestic(['ls', '--json', snapshot.id]);
|
||||
const result = await runRestic(['--no-lock', 'ls', '--json', snapshot.id]);
|
||||
const entries = result.stdout
|
||||
.split('\n')
|
||||
.filter(Boolean)
|
||||
|
||||
@@ -40,7 +40,7 @@ export async function validateVmExists(vmName) {
|
||||
|
||||
export async function listSnapshotsForVm(vmName) {
|
||||
await validateVmExists(vmName);
|
||||
const result = await runRestic(['snapshots', '--json', '--tag', vmName]);
|
||||
const result = await runRestic(['--no-lock', 'snapshots', '--json', '--tag', vmName]);
|
||||
const snapshots = JSON.parse(result.stdout || '[]');
|
||||
return snapshots.sort((a, b) => String(b.time || '').localeCompare(String(a.time || '')));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user