Skip to content

Commit

Permalink
Merge pull request #138 from esimonov/master
Browse files Browse the repository at this point in the history
Fix DynamoDB limit
  • Loading branch information
esimonov authored Feb 19, 2021
2 parents cb104f3 + 180702b commit b122e36
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions storage/dynamodb/app_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,15 @@ func (as *AppStorage) UpdateApp(appID string, newApp model.AppData) (model.AppDa
return updatedApp, err
}

const maxAppsLimit = 20

// FetchApps fetches apps which name satisfies provided filterString.
// Supports pagination. Search is case-senstive for now.
func (as *AppStorage) FetchApps(filterString string, skip, limit int) ([]model.AppData, int, error) {
if limit == 0 || limit > maxAppsLimit {
limit = maxAppsLimit
}

scanInput := &dynamodb.ScanInput{
TableName: aws.String(appsTableName),
Limit: aws.Int64(int64(limit)),
Expand Down

0 comments on commit b122e36

Please sign in to comment.