Remove annoying nginx logging, fix amber sync, minor patches
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
"use server";
|
||||
|
||||
import { exec } from "node:child_process";
|
||||
import { env } from "node:process";
|
||||
import { promisify } from "node:util";
|
||||
import { revalidatePath } from "next/cache";
|
||||
import { actionLog } from "@/lib/api";
|
||||
@@ -26,7 +27,9 @@ export async function toggleEnka(state: boolean) {
|
||||
}
|
||||
|
||||
export async function syncAmber() {
|
||||
const res = await promisify(exec)("bun util/sync 2>&1");
|
||||
const res = await promisify(exec)("bun util/sync 2>&1", {
|
||||
env: { ...env, NO_AUTH_CHECK: "1" },
|
||||
});
|
||||
actionLog("Triggered an Amber sync", { result: res.stdout });
|
||||
return res.stdout;
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ export function LimitManager({
|
||||
setDialog(1);
|
||||
}}
|
||||
>
|
||||
<span>ตั้ง Limit</span>
|
||||
<span>ตั้งจำกัดคิว</span>
|
||||
</DropdownMenuItem>
|
||||
</DialogTrigger>
|
||||
<DropdownMenuItem onClick={toggleLock}>
|
||||
@@ -161,7 +161,7 @@ export function LimitManager({
|
||||
{dialog === 1 ? (
|
||||
<DialogContent>
|
||||
<DialogHeader>
|
||||
<DialogTitle>ตั้ง Limit</DialogTitle>
|
||||
<DialogTitle>ตั้งจำกัดคิว</DialogTitle>
|
||||
</DialogHeader>
|
||||
<form
|
||||
id="limit-form"
|
||||
@@ -277,7 +277,7 @@ export function Watcher() {
|
||||
const count = useRef<number | undefined>(undefined);
|
||||
// Reload after connection restored
|
||||
shared.signal("sync", () => router.refresh());
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
const es = new EventSource(`/api/rubgram/ev`);
|
||||
es.addEventListener("update", () => router.refresh());
|
||||
|
||||
Reference in New Issue
Block a user