Skip to content
Snippets Groups Projects
Commit 5617bf56 authored by Travis Ralston's avatar Travis Ralston
Browse files

Fix deadlock condition in URL previews

parent f4432932
No related branches found
No related tags found
No related merge requests found
......@@ -38,7 +38,9 @@ func GetPreview(urlStr string, onHost string, forUserId string, atTs int64, ctx
}
now := util.NowMillis()
if (now - atTs) > 60000 {
atTsBk := stores.GetBucketTs(atTs)
nowBk := stores.GetBucketTs(now)
if (now - atTs) > 60000 && atTsBk != nowBk {
// Because we don't have a cached preview, we'll use the current time as the preview time.
// We also give a 60 second buffer so we don't cause an infinite loop (considering we're
// calling ourselves), and to give a lenient opportunity for slow execution.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment