Merge branch 'develop' into feat/be/error-handling

This commit is contained in:
Alexander Holliday authored and GitHub committed 2024-09-15 17:23:40 -07:00
commit 858df84a9e
1 file changed
+14
+14
View File
@@ -259,6 +259,20 @@ const updateChecksTTL = async (teamId, ttl) => {
}
};
const updateChecksTTL = async (teamId, ttl) => {
try {
await Check.collection.dropIndex("expiry_1");
await Check.collection.createIndex(
{ expiry: 1 },
{ expireAfterSeconds: ttl } // TTL in seconds, adjust as necessary
);
} catch (error) {
error.service = SERVICE_NAME;
error.method = "updateChecksTTL";
throw error;
}
};
module.exports = {
createCheck,
getChecksCount,