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

Adding support for long retention to sampled workflows #1141

Merged
merged 2 commits into from
Sep 25, 2018

Conversation

yiminc-zz
Copy link

Adding support for sampled retentions.

func (entry *DomainCacheEntry) GetRetentionDays(workflowID string) int32 {
if sampledRetentionValue, ok := entry.info.Data[SampleRetentionKey]; ok {
sampledRetentionDays, err := strconv.Atoi(sampledRetentionValue)
if err != nil && sampledRetentionDays < int(entry.config.Retention) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like a logic bug. Replace with ||

h.Write([]byte(workflowID))
hash := h.Sum32()

r := float64(hash%1000) / float64(1000)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you put a comment on explaining the math.

Copy link
Contributor

@samarabbas samarabbas left a comment

Choose a reason for hiding this comment

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

Looks good. You can land this after addressing my comments.

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