debug: re-enable Automod with extra profiling
This commit is contained in:
parent
2d012bc5cf
commit
53d7491c1b
8 changed files with 43 additions and 8 deletions
|
@ -1,6 +1,7 @@
|
|||
import { GuildPluginData } from "knub";
|
||||
import { RecentActionType } from "../constants";
|
||||
import { AutomodPluginType } from "../types";
|
||||
import { startProfiling } from "../../../utils/easyProfiler";
|
||||
|
||||
export function getMatchingRecentActions(
|
||||
pluginData: GuildPluginData<AutomodPluginType>,
|
||||
|
@ -9,9 +10,10 @@ export function getMatchingRecentActions(
|
|||
since: number,
|
||||
to?: number,
|
||||
) {
|
||||
const stopProfiling = startProfiling(pluginData.getKnubInstance().profiler, "automod:fns:getMatchingRecentActions");
|
||||
to = to || Date.now();
|
||||
|
||||
return pluginData.state.recentActions.filter((action) => {
|
||||
const result = pluginData.state.recentActions.filter((action) => {
|
||||
return (
|
||||
action.type === type &&
|
||||
(!identifier || action.identifier === identifier) &&
|
||||
|
@ -20,4 +22,6 @@ export function getMatchingRecentActions(
|
|||
!action.context.actioned
|
||||
);
|
||||
});
|
||||
stopProfiling();
|
||||
return result;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue