mirror of
https://github.com/biersoeckli/QuickStack.git
synced 2026-02-10 13:39:07 -06:00
feat: add revalidation for QuickStack version cache before update
This commit is contained in:
@@ -106,11 +106,15 @@ export const cleanupOldBuildJobs = async () =>
|
||||
return new SuccessActionResult(undefined, 'Successfully cleaned up old build jobs.');
|
||||
});
|
||||
|
||||
export const revalidateQuickStackVersionCache = async () =>
|
||||
simpleAction(async () => {
|
||||
revalidateTag(Tags.quickStackVersionInfo()); // separated because updateFunction restarts backend wich results in error
|
||||
});
|
||||
|
||||
export const updateQuickstack = async () =>
|
||||
simpleAction(async () => {
|
||||
await getAdminUserSession();
|
||||
const useCaranyChannel = await paramService.getBoolean(ParamService.USE_CANARY_CHANNEL, false);
|
||||
revalidateTag(Tags.quickStackVersionInfo());
|
||||
await quickStackService.updateQuickStack(useCaranyChannel);
|
||||
return new SuccessActionResult(undefined, 'QuickStack will be updated, refresh the page in a few seconds.');
|
||||
});
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
'use client';
|
||||
|
||||
import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { setCanaryChannel, updateQuickstack } from "./actions";
|
||||
import { revalidateQuickStackVersionCache, setCanaryChannel, updateQuickstack } from "./actions";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Toast } from "@/frontend/utils/toast.utils";
|
||||
import { useConfirmDialog } from "@/frontend/states/zustand.states";
|
||||
@@ -31,7 +31,8 @@ export default function QuickStackVersionInfo({
|
||||
description: 'This action will restart the QuickStack service and installs the latest version. It may take a few minutes to complete.',
|
||||
okButton: "Update QuickStack",
|
||||
})) {
|
||||
Toast.fromAction(() => updateQuickstack());
|
||||
await revalidateQuickStackVersionCache(); // separated because updateFunction restarts backend wich results in error
|
||||
await Toast.fromAction(() => updateQuickstack());
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user