Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion server/src/addie/admin-status-lookup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const AAO_ADMIN_WORKING_GROUP_SLUG = 'aao-admin';
// performed an admin grant/revoke. Other replicas must therefore re-check
// membership quickly enough for an emergency revocation to take effect.
export const AAO_ADMIN_POSITIVE_CACHE_TTL_MS = 60 * 1000;
const AAO_ADMIN_NEGATIVE_CACHE_TTL_MS = 5 * 60 * 1000;
const AAO_ADMIN_NEGATIVE_CACHE_TTL_MS = 60 * 1000;

const wgDb = new WorkingGroupDatabase();

Expand Down
5 changes: 2 additions & 3 deletions server/src/addie/mcp/admin-tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ const KITCHEN_CABINET_SLUG = "kitchen-cabinet";
// Site-admin membership can be revoked on another replica. Keep successful
// membership decisions short-lived so every replica rechecks within a minute.
const ADMIN_POSITIVE_CACHE_TTL_MS = 60 * 1000;
const ADMIN_NEGATIVE_CACHE_TTL_MS = 5 * 60 * 1000;
const ADMIN_NEGATIVE_CACHE_TTL_MS = 60 * 1000;
const COUNCIL_CACHE_TTL_MS = 30 * 60 * 1000;
// Shared cache module — invalidators can be called without dragging the
// rest of admin-tools (and its Anthropic-instantiating dependencies)
Expand Down Expand Up @@ -247,10 +247,9 @@ export async function isSlackUserAAOAdmin(

if (!adminGroup) {
logger.warn("Admin check: aao-admin working group not found in DB");
// Cache the negative result for a shorter time to avoid repeated DB lookups
adminStatusCache.set(slackUserId, {
isAdmin: false,
expiresAt: Date.now() + 5 * 60 * 1000,
expiresAt: Date.now() + ADMIN_NEGATIVE_CACHE_TTL_MS,
});
return false;
}
Expand Down
Loading