Skip to content

Commit

Permalink
[Waste] Clear slots before reserving anew.
Browse files Browse the repository at this point in the history
  • Loading branch information
dracos authored and davea committed Nov 8, 2023
1 parent 6a2252b commit e52a155
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions perllib/FixMyStreet/Roles/CobrandEcho.pm
Original file line number Diff line number Diff line change
Expand Up @@ -696,10 +696,13 @@ sub check_bulky_slot_available {

# Note: Both $slot_expiry_dt and $now_dt are UTC
if ( $slot_expiry_dt <= $now_dt ) {
# Call ReserveAvailableSlots again, try to get
# the same collection date
# Cancel the expired slots and call ReserveAvailableSlots again, try to
# get the same collection date
my $property = $self->{c}->stash->{property};
$self->clear_cached_lookups_bulky_slots($property->{id});

my $available_slots = $self->find_available_bulky_slots(
$self->{c}->stash->{property}, undef, 'no_cache' );
$property, undef, 'no_cache' );

my ($slot) = grep { $_->{date} eq $collection_date } @$available_slots;

Expand Down

0 comments on commit e52a155

Please sign in to comment.