Skip to content

Commit 61de772

Browse files
Boris Dorofeevnodkz
Boris Dorofeev
authored andcommitted
fix: durationAvg type
relates: #83
1 parent 2b4f40d commit 61de772

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/types/queue/Queue.durationAvg.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export function createDurationAvgFC(
88
opts: Options
99
): ObjectTypeComposerFieldConfigDefinition<any, any> {
1010
return {
11-
type: 'Int!',
11+
type: 'String!',
1212
args: {
1313
limit: {
1414
type: 'Int',
@@ -20,15 +20,15 @@ export function createDurationAvgFC(
2020
let amount = 0;
2121
let counter = 0;
2222
if (jobs.length === 0) {
23-
return 0;
23+
return '0';
2424
} else {
2525
for (const job of jobs) {
2626
if (job?.finishedOn && job?.processedOn) {
2727
amount += job.finishedOn - job.processedOn;
2828
counter++;
2929
}
3030
}
31-
return (amount / (counter || 1)).toFixed(0);
31+
return String((amount / (counter || 1)).toFixed(0));
3232
}
3333
},
3434
};

0 commit comments

Comments
 (0)