From 6d1fd3b5874b0f78a0ac4d17d0494394352b2cbd Mon Sep 17 00:00:00 2001 From: Mike Rylander Date: Mon, 1 Jun 2020 17:42:06 -0400 Subject: [PATCH] (Correctly) Use idlist function to reduce network overhead Signed-off-by: Mike Rylander --- .../perlmods/lib/OpenILS/Application/Curbside.pm | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Curbside.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Curbside.pm index de1f6889bf..baf8ce1af8 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Curbside.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Curbside.pm @@ -158,10 +158,10 @@ sub fetch_latest_delivered { # returns appointments delivered TODAY arrival => { '!=' => undef}, delivered => { '>' => 'today'}, },{ - idlist => 1, order_by => { acsp => {delivered => {direction => 'desc'}} } - }]); + order_by => { acsp => {delivered => {direction => 'desc'}} } + }],{ idlist => 1 }); - return md5_hex( join(',', map { $_->id . $_->slot // '' } @$slots) ); + return md5_hex( join(',', @$slots) ); } __PACKAGE__->register_method( method => "fetch_latest_delivered", @@ -245,10 +245,10 @@ sub fetch_latest_arrived { arrival => { '!=' => undef}, delivered => undef, },{ - idlist => 1, order_by => { acsp => { arrival => { direction => 'desc' } } } - }]); + order_by => { acsp => { arrival => { direction => 'desc' } } } + }],{ idlist => 1 }); - return md5_hex( join(',', map { $_->id . $_->slot // '' } @$slots) ); + return md5_hex( join(',', @$slots) ); } __PACKAGE__->register_method( method => "fetch_latest_arrived", @@ -332,14 +332,13 @@ sub fetch_latest_staged { staged => { '!=' => undef}, arrival => undef },{ - idlist => 1, # fully ordered IDs will capture insertion, deletion, AND edit order_by => [ { class => acsp => field => slot => direction => 'desc' }, { class => acsp => field => id => direction => 'desc' } ] - }]); + }],{ idlist => 1 }); - return md5_hex( join(',', map { $_->id . $_->slot // '' } @$slots) ); + return md5_hex( join(',', @$slots) ); } __PACKAGE__->register_method( method => "fetch_latest_staged", @@ -443,14 +442,13 @@ sub fetch_latest_to_be_staged { staged => undef, slot => { '<=' => $horizon->strftime('%FT%T%z') }, },{ - idlist => 1, # fully ordered IDs will capture insertion, deletion, AND edit order_by => [ { class => acsp => field => slot => direction => 'desc' }, { class => acsp => field => id => direction => 'desc' } ] - }]); + }],{ idlist => 1 }); - return md5_hex( join(',', map { $_->id . $_->slot // '' } @$slots) ); + return md5_hex( join(',', @$slots) ); } __PACKAGE__->register_method( method => "fetch_latest_to_be_staged", -- 2.11.0