Skip to content

Commit

Permalink
disable guildmembercache
Browse files Browse the repository at this point in the history
Signed-off-by: GitHub <[email protected]>
  • Loading branch information
metal0 authored Jan 15, 2024
1 parent b47db15 commit 39e8367
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
3 changes: 1 addition & 2 deletions backend/src/plugins/Persist/PersistPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { GuildLogs } from "../../data/GuildLogs";
import { GuildPersistedData } from "../../data/GuildPersistedData";
import { makeIoTsConfigParser } from "../../pluginUtils";
import { trimPluginDescription } from "../../utils";
import { GuildMemberCachePlugin } from "../GuildMemberCache/GuildMemberCachePlugin";
import { LogsPlugin } from "../Logs/LogsPlugin";
import { RoleManagerPlugin } from "../RoleManager/RoleManagerPlugin";
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
Expand Down Expand Up @@ -31,7 +30,7 @@ export const PersistPlugin = zeppelinGuildPlugin<PersistPluginType>()({
configSchema: ConfigSchema,
},

dependencies: () => [LogsPlugin, RoleManagerPlugin, GuildMemberCachePlugin],
dependencies: () => [LogsPlugin, RoleManagerPlugin],
configParser: makeIoTsConfigParser(ConfigSchema),
defaultOptions,

Expand Down
6 changes: 4 additions & 2 deletions backend/src/plugins/Persist/events/StoreDataEvt.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { PersistedData } from "../../../data/entities/PersistedData";
import { GuildMemberCachePlugin } from "../../GuildMemberCache/GuildMemberCachePlugin";
import { persistEvt } from "../types";

export const StoreDataEvt = persistEvt({
Expand All @@ -9,8 +8,11 @@ export const StoreDataEvt = persistEvt({
const config = await pluginData.config.getForUser(member.user);
const persistData: Partial<PersistedData> = {};

// FIXME: New caching thing, or fix deadlocks with this plugin
if (member.partial) {
return;
// Djs hasn't cached member data => use db cache
/*
const data = await pluginData.getPlugin(GuildMemberCachePlugin).getCachedMemberData(member.id);
if (!data) {
return;
Expand All @@ -22,7 +24,7 @@ export const StoreDataEvt = persistEvt({
}
if (config.persist_nicknames && data.nickname) {
persistData.nickname = data.nickname;
}
}*/
} else {
// Djs has cached member data => use that
const memberRoles = Array.from(member.roles.cache.keys());
Expand Down
5 changes: 2 additions & 3 deletions backend/src/plugins/availablePlugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { CustomEventsPlugin } from "./CustomEvents/CustomEventsPlugin";
import { GuildAccessMonitorPlugin } from "./GuildAccessMonitor/GuildAccessMonitorPlugin";
import { GuildConfigReloaderPlugin } from "./GuildConfigReloader/GuildConfigReloaderPlugin";
import { GuildInfoSaverPlugin } from "./GuildInfoSaver/GuildInfoSaverPlugin";
import { GuildMemberCachePlugin } from "./GuildMemberCache/GuildMemberCachePlugin";
import { InternalPosterPlugin } from "./InternalPoster/InternalPosterPlugin";
import { LocateUserPlugin } from "./LocateUser/LocateUserPlugin";
import { LogsPlugin } from "./Logs/LogsPlugin";
Expand Down Expand Up @@ -54,7 +53,7 @@ export const guildPlugins: Array<ZeppelinGuildPluginBlueprint<any>> = [
PostPlugin,
ReactionRolesPlugin,
MessageSaverPlugin,
GuildMemberCachePlugin,
// GuildMemberCachePlugin, // FIXME: New caching thing, or fix deadlocks with this plugin
ModActionsPlugin,
NameHistoryPlugin,
RemindersPlugin,
Expand Down Expand Up @@ -93,7 +92,7 @@ export const baseGuildPlugins: Array<ZeppelinGuildPluginBlueprint<any>> = [
GuildInfoSaverPlugin,
MessageSaverPlugin,
NameHistoryPlugin,
GuildMemberCachePlugin,
// GuildMemberCachePlugin, // FIXME: New caching thing, or fix deadlocks with this plugin
CasesPlugin,
MutesPlugin,
TimeAndDatePlugin,
Expand Down

0 comments on commit 39e8367

Please sign in to comment.