projects
/
Biblio-RFID.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cd311d5
)
invalidate cache of tags for unselected readers
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Wed, 29 Oct 2014 13:45:59 +0000
(14:45 +0100)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Wed, 29 Oct 2014 13:45:59 +0000
(14:45 +0100)
lib/Biblio/RFID/Reader.pm
patch
|
blob
|
history
diff --git
a/lib/Biblio/RFID/Reader.pm
b/lib/Biblio/RFID/Reader.pm
index
c66febd
..
e3f9d6e
100644
(file)
--- a/
lib/Biblio/RFID/Reader.pm
+++ b/
lib/Biblio/RFID/Reader.pm
@@
-55,7
+55,15
@@
sub tags {
foreach my $rfid ( @{ $self->{_readers} } ) {
if ( exists $triggers->{reader} ) {
- next unless $triggers->{reader}->($rfid);
+ if ( ! $triggers->{reader}->($rfid) ) {
+ # invalidate tags from other readers
+ if ( exists $self->{_tags} ) {
+ delete $self->{_tags}->{$_} foreach (
+ grep { $self->{_tags}->{$_}->{reader} eq ref $rfid } keys %{ $self->{_tags} }
+ );
+ }
+ next;
+ }
}
warn "# inventory on $rfid";