fix: report partial inventory refresh
This commit is contained in:
1 parent
25cc3b9402
commit
6f85e18065
4 files changed
+13
-5
No files matched your search
@@ -44,10 +44,12 @@ try {
|
||||
const publishDockerInventoryRefreshAsync = async () => {
|
||||
try {
|
||||
await dockerInventoryRefreshChannel.publishAsync({ requestedAt: Date.now() });
|
||||
return true;
|
||||
} catch (error) {
|
||||
if (!isRedisDisabled()) {
|
||||
logger.warn(new Error("Failed to publish Docker inventory refresh", { cause: error }));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -91,7 +93,9 @@ export const dockerRouter = createTRPCRouter({
|
||||
.concat(dockerMiddleware())
|
||||
.mutation(async () => {
|
||||
resetDockerInventory();
|
||||
await publishDockerInventoryRefreshAsync();
|
||||
const propagated = await publishDockerInventoryRefreshAsync();
|
||||
if (propagated) return { scope: "all" as const };
|
||||
return { scope: "local" as const };
|
||||
}),
|
||||
getContainers: permissionRequiredProcedure
|
||||
.requiresPermission("admin")
|
||||
|
||||
Reference in new issue
Block a user