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

Async cache setting #1736

Closed
wants to merge 4 commits into from
Closed

Async cache setting #1736

wants to merge 4 commits into from

Conversation

AvaniMakwana
Copy link
Collaborator

Resolves #1537 (if appropriate)

Description

Add 'bypassCache' property to Async to enable/disable caching.

Motivation and Context

Enable / Disable Caching via Async properties

How Has This Been Tested?

Unit tests included.

Screenshots (if appropriate):

License

I confirm that this contribution is made under an Apache 2.0 license and that I have the authority necessary to make this contribution on behalf of its copyright owner.

@@ -49,10 +53,13 @@ public AsyncAPIResult call() throws URISyntaxException, NoHttpResponseException
ElideResponse response = null;
log.debug("AsyncQuery Object from request: {}", this);
UUID requestUUID = UUID.fromString(queryObj.getRequestId());
Map<String, List<String>> bypassCacheMap = new HashMap<String, List<String>>();
bypassCacheMap.put("bypasscache", Arrays.asList(String.valueOf(service.isBypassCache())));
Copy link
Member

Choose a reason for hiding this comment

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

Won't this always override the cache? I don't think this is the behavior that we want.

if (queryObj.getQueryType().equals(QueryType.JSONAPI_V1_0)) {
response = executeJsonApiRequest(service.getElide(), user, apiVersion, requestUUID);
response = executeJsonApiRequest(service.getElide(), user, apiVersion, requestUUID, bypassCacheMap);
Copy link
Member

Choose a reason for hiding this comment

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

Instead of naming the variable bypassCacheMap, call it headers. It is a better reflection of what the map represents.

@AvaniMakwana
Copy link
Collaborator Author

Closing since we are going to enable / disable caching based on Max cache size property, not on/off property

@aklish aklish deleted the async-cache-setting branch October 29, 2021 21:18
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.

Elide 5: Add setting to turn on/off caching for async downloads.
3 participants