func pollForTableCreation()

in workload-management/s3-trigger-ecs-task/s3-file-processor/utils/Dynamodb.go [266:291]


func pollForTableCreation() error {
	index := 0
	var (
		status *string
		err    error
	)
	for index < RetryCounter {
		status, err = getTableStatus()
		if err != nil {
			log.Printf("Error while polling table %s", err.Error())
			return err
		} else {
			if *status == "ACTIVE" {
				break
			}
			time.Sleep(5 * time.Second)
			index++
		}
	}

	if index > RetryCounter {
		return errors.New("max retry exceeded for create table status change " + *status)
	}

	return nil
}