adjust hashing for fetch_*.latest
authorGalen Charlton <gmc@equinoxinitiative.org>
Fri, 29 May 2020 19:31:33 +0000 (15:31 -0400)
committerGalen Charlton <gmc@equinoxinitiative.org>
Fri, 29 May 2020 19:31:33 +0000 (15:31 -0400)
Perl's hash order randomization was getting in the way.

Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/src/perlmods/lib/OpenILS/Application/Curbside.pm

index a6369d1..28c03a2 100644 (file)
@@ -122,7 +122,7 @@ sub fetch_latest_delivered { # returns appointments delivered TODAY
         idlist => 1, order_by => { acsp => {delivered => {direction => 'desc'}} }
     }]);
 
-    return md5_hex( join(',', @$slots) );
+    return md5_hex( join(',', map { $_->id . $_->slot // '' } @$slots) );
 }
 __PACKAGE__->register_method(
     method   => "fetch_latest_delivered",
@@ -209,7 +209,7 @@ sub fetch_latest_arrived {
         idlist => 1, order_by => { acsp => { arrival => { direction => 'desc' } } }
     }]);
 
-    return md5_hex( join(',', @$slots) );
+    return md5_hex( join(',', map { $_->id . $_->slot // '' } @$slots) );
 }
 __PACKAGE__->register_method(
     method   => "fetch_latest_arrived",
@@ -300,7 +300,7 @@ sub fetch_latest_staged {
         ]
     }]);
 
-    return md5_hex( join(',', @$slots) );
+    return md5_hex( join(',', map { $_->id . $_->slot // '' } @$slots) );
 }
 __PACKAGE__->register_method(
     method   => "fetch_latest_staged",
@@ -411,7 +411,7 @@ sub fetch_latest_to_be_staged {
         ]
     }]);
 
-    return md5_hex( join(',', @$slots) );
+    return md5_hex( join(',', map { $_->id . $_->slot // '' } @$slots) );
 }
 __PACKAGE__->register_method(
     method   => "fetch_latest_to_be_staged",