getJobCountByStatus method

Future<int> getJobCountByStatus(
  1. BackgroundJobStatus status
)

Gets the count of jobs with a specific status.

Implementation

Future<int> getJobCountByStatus(BackgroundJobStatus status) async {
  final result = await db.get(
    "SELECT COUNT(*) as count FROM background_service_jobs WHERE status = ?",
    [status.name.toUpperCase()],
  );
  return (result['count'] as int?) ?? 0;
}