Fix "too many SQL variables" error in GetStarred endpoint

This commit is contained in:
Deluan 2021-07-21 10:45:52 -04:00
parent 4f9d546da4
commit 4fcb238295
2 changed files with 63 additions and 45 deletions

View file

@ -53,6 +53,17 @@ func BreakUpStringSlice(items []string, chunkSize int) [][]string {
return chunks
}
func RangeByChunks(items []string, chunkSize int, cb func([]string) error) error {
chunks := BreakUpStringSlice(items, chunkSize)
for _, chunk := range chunks {
err := cb(chunk)
if err != nil {
return err
}
}
return nil
}
func LongestCommonPrefix(list []string) string {
if len(list) == 0 {
return ""