code: func ScheduleDeviceQueueBatch(size int) error {
  	return storage.Transaction(func(tx sqlx.Ext) error {
  		devices, err := storage.GetDevicesWithClassBOrClassCDeviceQueueItems(tx, size)
  		if err != nil {
  			return errors.Wrap(err, "get deveuis with class-c device-queue items error")
  		}
  
  		for _, d := range devices {
  			ds, err := storage.GetDeviceSession(storage.RedisPool(), d.DevEUI)
  			if err != nil {
  				log.WithError(err).WithField("dev_eui", d.DevEUI).Error("get device-session error")
  				continue
  			}
  
  			err = data.HandleScheduleNextQueueItem(ds, d.Mode)
  			if err != nil {
  				log.WithError(err).WithField("dev_eui", d.DevEUI).Error("schedule next device-queue item error")
  			}
  		}
  
  		return nil
  	})
  }
docs: // ScheduleDeviceQueueBatch schedules a downlink batch (Class-B or Class-C).