getPendingUploads method

Future<List<Map<String, dynamic>>> getPendingUploads(
  1. DateTime now,
  2. int maxRetries
)

Returns pending uploads whose next_retry_at <= now and attempts < maxRetries.

Implementation

Future<List<Map<String, dynamic>>> getPendingUploads(
  DateTime now,
  int maxRetries,
) async {
  final db = await database;
  return db.query(
    'pending_uploads',
    where: 'next_retry_at <= ? AND attempts < ?',
    whereArgs: [now.toIso8601String(), maxRetries],
    orderBy: 'created_at ASC',
  );
}