getFailedJobs method

Future<HealthQueue> getFailedJobs({
  1. required Name name,
  2. int? threshold,
})

Get number of failed queue jobs

Returns the amount of failed jobs in a given queue.

Implementation

Future<models.HealthQueue> getFailedJobs(
    {required enums.Name name, int? threshold}) async {
  final String apiPath =
      '/health/queue/failed/{name}'.replaceAll('{name}', name.value);

  final Map<String, dynamic> apiParams = {
    'threshold': threshold,
  };

  final Map<String, String> apiHeaders = {
    'content-type': 'application/json',
  };

  final res = await client.call(HttpMethod.get,
      path: apiPath, params: apiParams, headers: apiHeaders);

  return models.HealthQueue.fromMap(res.data);
}