Skip to main content

GUILD_CHANNEL_GENERATIONS

Static GUILD_CHANNEL_GENERATIONS 

Source
static GUILD_CHANNEL_GENERATIONS: LazyLock<Mutex<HashMap<Id<GuildMarker>, u64>>>
Expand description

How many channel changes Discord has reported for each guild.

Why not rely on dropping cache entries alone: a lookup already in flight when a change is reported inserts what it read afterwards, and the cache cannot tell that apart from fresh data. Cached channels instead record the generation from before they were read, and only the current generation’s are served.

Why entries are never removed: a counter restarting from zero would make data read under the earlier zero look current again.