all repos — honk @ 181a2352b21afa2e40190a05ab8c260d8eb498dc

my fork of honk

try harder to retrieve threads from the database
Ted Unangst tedu@tedunangst.com
Fri, 08 Mar 2024 02:37:37 -0500
commit

181a2352b21afa2e40190a05ab8c260d8eb498dc

parent

08df567edc039a043d062d47e9a9893d7762cdb7

2 files changed, 31 insertions(+), 0 deletions(-)

jump to
M database.godatabase.go

@@ -293,6 +293,33 @@ }

func gethonksbyconvoy(userid UserID, convoy string, wanted int64) []*Honk { rows, err := stmtHonksByConvoy.Query(wanted, userid, userid, convoy) honks := getsomehonks(rows, err) + seen := make(map[string]bool, len(honks)) + for _, h := range honks { + seen[h.XID] = true + } + var missing []string + for _, h := range honks { + if h.RID != "" && !seen[h.RID] { + missing = append(missing, h.RID) + } + } + for len(missing) > 0 { + dlog.Printf("missing honks: %v", missing) + nextround := missing + missing = nil + for _, xid := range nextround { + seen[xid] = true + } + for _, xid := range nextround { + h := getxonk(userid, xid) + if h != nil { + honks = append(honks, h) + if h.RID != "" && !seen[h.RID] { + missing = append(missing, h.RID) + } + } + } + } return honks } func gethonksbysearch(userid UserID, q string, wanted int64) []*Honk {
M docs/changelog.txtdocs/changelog.txt

@@ -1,5 +1,9 @@

changelog +### next + ++ Try harder to retrieve threads from the database. + ### 1.3.1 Retooled Reticule + Some logging fixes.