# least one potential copy with the context hold, plus any holds that
# share the same hold type and target. The latter part exists to
# accomodate holds that currently have no potential copies
- my $q_holds = $e->json_query({
+ my $q_holds = $hold->capture_time ? [] :$e->json_query({
# fetch cut_in_line and request_time since they're in the order_by
# and we're asking for distinct values
my $qpos = 1;
- for my $h (@$q_holds) {
- last if $h->{id} == $hold->id;
- $qpos++;
+ if (!$hold->capture_time) {
+ for my $h (@$q_holds) {
+ last if $h->{id} == $hold->id;
+ $qpos++;
+ }
}
- my $hold_data = $e->json_query({
+ my $hold_data = $hold->capture_time ? [] : $e->json_query({
select => {
acp => [ {column => 'id', transform => 'count', aggregate => 1, alias => 'count'} ],
ccm => [ {column =>'avg_wait_time'} ]
$num_potentials += $count;
}
+ $num_potentials = 1 if $hold->capture_time;
my $estimated_wait = -1;
if($num_potentials) {