mirror of
https://github.com/immich-app/immich.git
synced 2026-05-18 03:10:24 +03:00
chore: reload tables if job queue empties
This commit is contained in:
@@ -88,8 +88,10 @@
|
|||||||
expectingUpdate = true;
|
expectingUpdate = true;
|
||||||
} else if (expectingUpdate) {
|
} else if (expectingUpdate) {
|
||||||
integrityReport = await getIntegrityReportSummary();
|
integrityReport = await getIntegrityReportSummary();
|
||||||
|
expectingUpdate = false;
|
||||||
}
|
}
|
||||||
await asyncTimeout(5000);
|
|
||||||
|
await asyncTimeout(2000);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,14 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import AdminPageLayout from '$lib/components/layouts/AdminPageLayout.svelte';
|
import AdminPageLayout from '$lib/components/layouts/AdminPageLayout.svelte';
|
||||||
import { AppRoute } from '$lib/constants';
|
import { AppRoute } from '$lib/constants';
|
||||||
|
import { asyncTimeout } from '$lib/utils';
|
||||||
import { handleError } from '$lib/utils/handle-error';
|
import { handleError } from '$lib/utils/handle-error';
|
||||||
import {
|
import {
|
||||||
createJob,
|
createJob,
|
||||||
deleteIntegrityReport,
|
deleteIntegrityReport,
|
||||||
getBaseUrl,
|
getBaseUrl,
|
||||||
getIntegrityReport,
|
getIntegrityReport,
|
||||||
|
getQueuesLegacy,
|
||||||
IntegrityReportType,
|
IntegrityReportType,
|
||||||
ManualJobName,
|
ManualJobName,
|
||||||
} from '@immich/sdk';
|
} from '@immich/sdk';
|
||||||
@@ -27,6 +29,7 @@
|
|||||||
mdiPageFirst,
|
mdiPageFirst,
|
||||||
mdiTrashCanOutline,
|
mdiTrashCanOutline,
|
||||||
} from '@mdi/js';
|
} from '@mdi/js';
|
||||||
|
import { onDestroy, onMount } from 'svelte';
|
||||||
import { t } from 'svelte-i18n';
|
import { t } from 'svelte-i18n';
|
||||||
import { SvelteSet } from 'svelte/reactivity';
|
import { SvelteSet } from 'svelte/reactivity';
|
||||||
import type { PageData } from './$types';
|
import type { PageData } from './$types';
|
||||||
@@ -137,6 +140,27 @@
|
|||||||
],
|
],
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let running = true;
|
||||||
|
let expectingUpdate = false;
|
||||||
|
|
||||||
|
onMount(async () => {
|
||||||
|
while (running) {
|
||||||
|
const jobs = await getQueuesLegacy();
|
||||||
|
if (jobs.integrityCheck.queueStatus.isActive) {
|
||||||
|
expectingUpdate = true;
|
||||||
|
} else if (expectingUpdate) {
|
||||||
|
await loadPage(page);
|
||||||
|
expectingUpdate = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
await asyncTimeout(2000);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
onDestroy(() => {
|
||||||
|
running = false;
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<AdminPageLayout
|
<AdminPageLayout
|
||||||
|
|||||||
Reference in New Issue
Block a user