Skip to content

Support ttl parameter#6

Merged
schernysh merged 5 commits intomasterfrom
support-ttl-parameter
Sep 21, 2018
Merged

Support ttl parameter#6
schernysh merged 5 commits intomasterfrom
support-ttl-parameter

Conversation

@dhutsalo
Copy link
Copy Markdown
Contributor

No description provided.

changed min and max expiry violation policy
this.config = config;
this.builder = builder;
this.currentDateProvider = currentDateProvider;
this.minExpiry = config.getMinExpiry();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

These two values are accessible from config field so why not inline config.get[Max|Min]Expiry() in adjustExpiry()?

}

private long adjustExpiry(Long expiry) {
if(expiry == null) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It's a matter of taste maybe but if-else if-else construction may convey logic more concisely.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

as for me its more readable and prevent unnecessary nesting

Comment thread src/main/resources/application.yml Outdated
---
spring.profiles: local
cache.expiry_sec: 300
cache.min_expiry: 60
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Since YAML supports hierarchical representation of parameters same could be expressed (better idiomatically) as follows:

cache:
  min_expiry: 60
  max_expiry: 28800

import org.prebid.cache.model.RequestObject;
import org.prebid.cache.repository.CacheConfig;
import org.prebid.cache.repository.ReactiveTestAerospikeRepositoryContext;
import org.prebid.cache.repository.aerospike.AerospikePropertyConfiguration;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Are these three imports actually used?

@schernysh schernysh merged commit 530f04c into master Sep 21, 2018
@schernysh schernysh deleted the support-ttl-parameter branch September 21, 2018 14:25
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.

2 participants