Skip to content

Commit

Permalink
log capacity
Browse files Browse the repository at this point in the history
  • Loading branch information
josephjclark committed Sep 25, 2024
1 parent 86a5614 commit 4b94de4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/ws-worker/src/api/claim.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@ const claim = (

const activeWorkers = Object.keys(app.workflows).length;
if (activeWorkers >= maxWorkers) {
logger.debug('skipping claim attempt: server at capacity');
logger.debug(`skipping claim attempt: server at capacity (${activeWorkers}/${maxWorkers})`);
return reject(new Error('Server at capacity'));
}

if (!app.queueChannel) {
logger.debug('skipping claim attempt: websocket unavailable');
return reject(new Error('No websocket available'));
}
logger.debug(`requesting run (capacity ${activeWorkers}/${maxWorkers})`);

logger.debug('requesting run...');
app.queueChannel
.push<ClaimPayload>(CLAIM, { demand: 1 })
.receive('ok', ({ runs }: ClaimReply) => {
Expand Down

0 comments on commit 4b94de4

Please sign in to comment.