Github integration (#6414)

Co-authored-by: Tom Moor <tom.moor@gmail.com>
This commit is contained in:
Apoorv Mishra
2024-03-23 19:39:28 +05:30
committed by GitHub
parent a648625700
commit 450d0d9355
47 changed files with 1710 additions and 93 deletions

View File

@@ -57,10 +57,25 @@ export class CacheHelper {
/**
* Gets key against which unfurl response for the given url is stored
*
* @param url The url to generate a key for
* @param teamId The team ID to generate a key for
* @param url The url to generate a key for
*/
public static getUnfurlKey(url: string, teamId: string) {
public static getUnfurlKey(teamId: string, url = "") {
return `unfurl:${teamId}:${url}`;
}
/**
* Clears all cache data with the given prefix
*
* @param prefix Prefix to clear cache data
*/
public static async clearData(prefix: string) {
const keys = await Redis.defaultClient.keys(`${prefix}*`);
await Promise.all(
keys.map(async (key) => {
await Redis.defaultClient.del(key);
})
);
}
}