Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions services/friendbot/init_friendbot.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,7 @@ func createMinionAccounts(botAccount internal.Account, botKeypair *keypair.Full,
return minions, errors.Wrap(rerr, "refreshing bot seqnum")
}
// The tx will create min(numRemainingMinions, minionBatchSize) Minion accounts.
numCreateMinions := minionBatchSize
if numRemainingMinions < minionBatchSize {
numCreateMinions = numRemainingMinions
}
numCreateMinions := min(numRemainingMinions, minionBatchSize)
log.Printf("Creating %d new minion accounts", numCreateMinions)
for i := 0; i < numCreateMinions; i++ {
minionKeypair, err := keypair.Random()
Expand Down
5 changes: 1 addition & 4 deletions services/ticker/internal/scraper/asset_scraper.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,10 +272,7 @@ func (c *ScraperConfig) parallelProcessAssets(assets []hProtocol.AssetStat, para
go func(start int) {
defer wg.Done()

end := start + chunkSize
if end > numAssets {
end = numAssets
}
end := min(start+chunkSize, numAssets)

// Each routine running concurrently has a separate cache of TOMLs
// loaded. A single shared cache would be better, but this is a
Expand Down
6 changes: 1 addition & 5 deletions services/ticker/internal/tickerdb/queries_trade.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,7 @@ func chunkifyDBTrades(sl []Trade, chunkSize int) [][]Trade {
length := len(sl)

for i := 0; i < numChunks; i++ {
end := start + chunkSize

if end > length {
end = length
}
end := min(start+chunkSize, length)
chunk := sl[start:end]
chunkedSlice = append(chunkedSlice, chunk)
start = end
Expand Down