-
Notifications
You must be signed in to change notification settings - Fork 491
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
Conversation
… 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))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
renderedTemplatesKey(st.Id)
cmd/bosun/database/state_data.go
Outdated
} | ||
state, err := d.getIncident(id, conn) | ||
if err != nil { | ||
if strings.Contains(err.Error(), "nil returned") { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
cmd/bosun/database/state_data.go
Outdated
|
||
//ledis uses XSCAN cursor "KV" MATCH foo | ||
//redis uses SCAN cursor MATCH foo | ||
cmd := "SCAN" |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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.
@captncraig Didn't find any problems testing this out, but needs conflicts resolved. |
No description provided.