Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Update integration tests to delete existing cache before creating one #63

Merged
merged 2 commits into from
Mar 30, 2022

Conversation

poppoerika
Copy link
Contributor

Based on our conversations here.

const listCacheResp = await momento.listCaches();
const cacheList = listCacheResp.getCaches().map(c => c.getName());
if (cacheList.includes(cacheName)) {
await momento.deleteCache(cacheName);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we now have limits on control plane api calls, you can just surround the delete call with a try catch and swallow the CacheDoesntExist error

@poppoerika poppoerika requested a review from bruuuuuuuce March 30, 2022 22:49
Copy link
Contributor

@kvcache kvcache left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@poppoerika poppoerika merged commit 847eb84 into main Mar 30, 2022
@poppoerika poppoerika deleted the fix/deleteCacheBeforeCreation branch March 30, 2022 22:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants