Skip to content

Commit

Permalink
Update OEmbedCacheCleanup method return type
Browse files Browse the repository at this point in the history
  • Loading branch information
matheusbsilva137 committed Dec 28, 2023
1 parent 84ca1f1 commit 248c95b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/meteor/server/methods/OEmbedCacheCleanup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ import { settings } from '../../app/settings/server';
declare module '@rocket.chat/ui-contexts' {
// eslint-disable-next-line @typescript-eslint/naming-convention
interface ServerMethods {
OEmbedCacheCleanup(): { message: string };
OEmbedCacheCleanup(): { message: string; params: unknown[] };
}
}

export const executeClearOEmbedCache = async () => {
const date = new Date();
const expirationDays = settings.get<number>('API_EmbedCacheExpirationDays');
date.setDate(date.getDate() - expirationDays);
await OEmbedCache.removeBeforeDate(date);
return OEmbedCache.removeBeforeDate(date);
};

Meteor.methods<ServerMethods>({
Expand Down

0 comments on commit 248c95b

Please sign in to comment.