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

Purge old Rendered Templates #2167

Merged
merged 11 commits into from Oct 18, 2017
Merged

Purge old Rendered Templates #2167

merged 11 commits into from Oct 18, 2017

Conversation

kylebrandt
Copy link
Member

No description provided.

Craig Peterson added 2 commits September 25, 2017 15:09
… used

used_memory:7078922104
used_memory_human:6.59G
used_memory_rss:7078863208
used_memory_rss_human:6.59G
used_memory_peak:15792637592
used_memory_peak_human:14.71G
used_memory_lua:37888
used_memory_lua_human:37.00K
used_cpu_sys:261.25
used_cpu_user:139.53
used_cpu_sys_children:0.00
used_cpu_user_children:0.00
continue
}
fmt.Println(st.Id, len(st.Events), st.Open)
s, err := redis.String(myConn.Do("GET", fmt.Sprintf("renderedTemplatesById:%d", st.Id)))
Copy link
Member Author

Choose a reason for hiding this comment

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

renderedTemplatesKey(st.Id)

@captncraig captncraig changed the title WIP: Purge old Templates Purge old Rendered Templates Oct 10, 2017
}
state, err := d.getIncident(id, conn)
if err != nil {
if strings.Contains(err.Error(), "nil returned") {
Copy link
Member Author

Choose a reason for hiding this comment

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

strings.Contains on error, combined with the match not being a constant doesn't seem safe in the long run.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, the problem there is that the error will already be wrapped at that point, and the inner error is not accessible. I guess I can also make a package function for that test though.


//ledis uses XSCAN cursor "KV" MATCH foo
//redis uses SCAN cursor MATCH foo
cmd := "SCAN"
Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe Redis and Ledis SCAN could be a function outside of this that can be reused (and make this func shorter)

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, we did that with some others, but the re-ordering of the args makes it tricky. I will factor out.

@kylebrandt
Copy link
Member Author

@captncraig Didn't find any problems testing this out, but needs conflicts resolved.

@kylebrandt kylebrandt merged commit 3866edf into master Oct 18, 2017
@kylebrandt kylebrandt deleted the purge-old-templates branch January 17, 2019 17:03
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.

None yet

2 participants