this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

split up createInvite batch calls (#296)

if we try to gift invite codes to more than a few hundred users at a
time, it fails because the request body is too big.

authored by

Whyrusleeping and committed by
GitHub
7ede4c35 b9ea88db

+15 -9
+1 -2
bgs/bgs.go
··· 100 100 events: evtman, 101 101 didr: didr, 102 102 blobs: blobs, 103 - 104 - ssl: ssl, 103 + ssl: ssl, 105 104 106 105 consumersLk: sync.RWMutex{}, 107 106 consumers: make(map[uint64]*SocketConsumer),
+14 -7
cmd/gosky/main.go
··· 1287 1287 } 1288 1288 } 1289 1289 1290 - _, err = comatproto.ServerCreateInviteCodes(context.TODO(), xrpcc, &comatproto.ServerCreateInviteCodes_Input{ 1291 - UseCount: int64(count), 1292 - ForAccounts: dids, 1293 - CodeCount: int64(num), 1294 - }) 1295 - if err != nil { 1296 - return err 1290 + for n := 0; n < len(dids); n += 500 { 1291 + slice := dids 1292 + if len(slice) > 500 { 1293 + slice = slice[:500] 1294 + } 1295 + 1296 + _, err = comatproto.ServerCreateInviteCodes(context.TODO(), xrpcc, &comatproto.ServerCreateInviteCodes_Input{ 1297 + UseCount: int64(count), 1298 + ForAccounts: slice, 1299 + CodeCount: int64(num), 1300 + }) 1301 + if err != nil { 1302 + return err 1303 + } 1297 1304 } 1298 1305 1299 1306 return nil