Comment 3 for bug 1516143

Revision history for this message
Josh Stompro (u-launchpad-stompro-org) wrote :

I found an easier way to address this issue by looking at and modifying the pending events for our phone hold pickup event definition before the pending events are processed.

So this ticket can be closed, I'm not going to try and adjust the pbx-allocator scripts to do the same thing.

So before processing the pending items, we run a script that invalidates with a custom user_data value any pending events where a completed event exists for that same customer in the last 12 hours.

Then once a day, move all the invalid events back to pending status so they can get evaluated again.

I placed my scripts in a gist in case anyone else want to see them.
https://gist.github.com/stompro/c1795afd55d28289b4ecd7e325e80ea3

This method could also be used to attack the problem in other ways that might be useful.

1. Only place calls for a pickup location after no more items have been placed on that locations holdshelf for x number of minutes.

2. Only place calls for a specific user once no more new events have been created for x number of minutes.

Josh