Skip to content

Commit

Permalink
Comments
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenhand committed Aug 13, 2024
1 parent bdf5d4b commit 30e098a
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ type EnvVars = {
*/
export const shouldHandle = (event: EventFields) => eventTypes.includes(event.EventType);

/**
* After a reservation is accepted, we reset the capacity to 1
* We only need to increase capacity temporarily to accept an additional task under certain circumstances like transfers and manual task pulls
* So since for 'regular' auto assigned tasks resetting to 1 is a noop, we can just always reset to 1 when any reservation is accepted / rejected
* @param context
* @param event
*/
export const handleEvent = async (context: Context<EnvVars>, event: EventFields) => {
try {
const {
Expand All @@ -59,7 +66,6 @@ export const handleEvent = async (context: Context<EnvVars>, event: EventFields)

// eslint-disable-next-line global-require,import/no-dynamic-require,prefer-destructuring
const adjustChatCapacity: AdjustChatCapacityType = require(path).adjustChatCapacity;

const body = {
workerSid,
adjustment: 'setTo1',
Expand Down

0 comments on commit 30e098a

Please sign in to comment.