mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-11 06:24:34 +00:00
fix: honor explicit Synology Chat rate-limit env values
Landed from contributor PR #39197 by @scoootscooob. Co-authored-by: scoootscooob <zhentongfan@gmail.com>
This commit is contained in:
@@ -130,4 +130,18 @@ describe("resolveAccount", () => {
|
||||
const account = resolveAccount(cfg);
|
||||
expect(account.allowedUserIds).toEqual(["u1", "u2"]);
|
||||
});
|
||||
|
||||
it("respects SYNOLOGY_RATE_LIMIT=0 instead of defaulting to 30", () => {
|
||||
process.env.SYNOLOGY_RATE_LIMIT = "0";
|
||||
const cfg = { channels: { "synology-chat": {} } };
|
||||
const account = resolveAccount(cfg);
|
||||
expect(account.rateLimitPerMinute).toBe(0);
|
||||
});
|
||||
|
||||
it("falls back to 30 for malformed SYNOLOGY_RATE_LIMIT values", () => {
|
||||
process.env.SYNOLOGY_RATE_LIMIT = "0abc";
|
||||
const cfg = { channels: { "synology-chat": {} } };
|
||||
const account = resolveAccount(cfg);
|
||||
expect(account.rateLimitPerMinute).toBe(30);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user