Skip to content

Commit

Permalink
chore: revalidates cache for standup
Browse files Browse the repository at this point in the history
  • Loading branch information
en3sis committed Sep 2, 2024
1 parent a4a1e81 commit 70bef00
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/controllers/plugins/standup.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,18 @@ import { updateMetadataGuildPlugin } from '../bot/plugins.controller'
import supabase from '../../libs/supabase'
import { scheduledTasks } from '../tasks/cron-jobs'
import { Hans } from '../..'
import { deleteFromCache } from '../../libs/node-cache'

export const standupPluginController = async (
interaction: CommandInteraction,
newSchedule: StandupScheduleMetadata,
) => {
try {
// Fetch current plugin data
const guildPlugin = await Hans.guildPluginSettings(interaction.guildId, 'standup')

// Force to update the cache from the database
deleteFromCache(`guildPlugins:${interaction.guildId}:standup`)
const guildPlugin = await Hans.guildPluginSettings(interaction.guildId, 'standup')
const currentSchedules: StandupScheduleMetadata[] = guildPlugin?.metadata || []

// Check if a schedule for this channel already exists
Expand Down

0 comments on commit 70bef00

Please sign in to comment.