gateway: hot-reload heartbeat when agents.list changes
When agents are added or removed via config changes, the heartbeat scheduler now restarts automatically. This ensures newly added agents get their heartbeat tasks scheduled without requiring a full gateway restart.
This commit is contained in:
parent
5f4715acfc
commit
dadf3367c1
@ -85,6 +85,12 @@ describe("buildGatewayReloadPlan", () => {
|
||||
expect(plan.reloadHooks).toBe(true);
|
||||
});
|
||||
|
||||
it("restarts heartbeat when agents.list changes", () => {
|
||||
const plan = buildGatewayReloadPlan(["agents.list"]);
|
||||
expect(plan.restartGateway).toBe(false);
|
||||
expect(plan.restartHeartbeat).toBe(true);
|
||||
});
|
||||
|
||||
it("restarts providers when provider config prefixes change", () => {
|
||||
const changedPaths = ["web.enabled", "channels.telegram.botToken"];
|
||||
const plan = buildGatewayReloadPlan(changedPaths);
|
||||
|
||||
@ -53,6 +53,7 @@ const BASE_RELOAD_RULES: ReloadRule[] = [
|
||||
kind: "hot",
|
||||
actions: ["restart-heartbeat"],
|
||||
},
|
||||
{ prefix: "agents.list", kind: "hot", actions: ["restart-heartbeat"] },
|
||||
{ prefix: "agent.heartbeat", kind: "hot", actions: ["restart-heartbeat"] },
|
||||
{ prefix: "cron", kind: "hot", actions: ["restart-cron"] },
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user