Skip to content
This repository was archived by the owner on Mar 25, 2019. It is now read-only.

Commit b5479b3

Browse files
author
Sjoerd Tieleman
committed
Merge pull request #47 from madebyhiro/pr/46
Prevent transcoder of communicating negative free slot count
2 parents 39aa80d + 768f9dc commit b5479b3

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

lib/job-handler.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ exports.find = function(id, callback) {
2424
}
2525

2626
exports.freeSlots = function() {
27-
return config['slots'] - slots.length;
27+
var freeSlots = config['slots'] - slots.length;
28+
return Math.max(freeSlots, 0);
2829
}
2930

3031
exports.cancelAndRemove = function(internalId, callback) {

0 commit comments

Comments
 (0)