sigo2copri content cache

This commit is contained in:
Rainer Gümpelein 2022-04-05 12:29:58 +02:00
parent d06556bd60
commit c40f326d37
8 changed files with 88 additions and 26 deletions

View file

@ -1034,7 +1034,7 @@ sub send_password(){
}
#TODO, not ready!
#sigobike just like caching and not realy used by app
sub sigobike_cupdate {
my $self = shift;
my $record_sigo = shift;
@ -1051,12 +1051,44 @@ sub sigobike_cupdate {
owner => "169",
};
$bw->log("UPDATE content from record_sigo with bike nr:",$record_sigo->{$bid}->{barcode},"");
#$rows = $self->update_record($dbh,$update,$record_sigo->{$bid}->{barcode});
$bw->log("UPDATE content from record_sigo with bike nr:",$update,"");
$rows = $dbt->update_record($dbh,$update,$record_sigo->{$bid});
if($rows != 1){
my $c_id = "";
$bw->log("INSERT content from record_sigo with bike nr:",$record_sigo->{$bid}->{barcode},"");
#$c_id = $self->insert_contentoid($dbh,$update,"");
$update->{itime} = "now()";
$bw->log("INSERT content from record_sigo with bike nr:",$update,"");
$c_id = $dbt->insert_contentoid($dbh,$update,"");
$rows = 1 if($c_id);
}
}
return $rows;
}
#sigostation just like caching and not realy used by app
sub sigostation_cupdate {
my $self = shift;
my $record_sigo = shift;
my $dbh = "";
my $rows = 0;
foreach my $sid (keys (%$record_sigo)){
my $update = {
%{$record_sigo->{$sid}},
table => "content",
template_id => "225",
main_id => "300016",
mtime => "now()",
owner => "169",
};
$bw->log("UPDATE content from record_sigo with bike nr:",$update,"");
$rows = $dbt->update_record($dbh,$update,$record_sigo->{$sid});
if($rows != 1){
my $c_id = "";
$update->{itime} = "now()";
$bw->log("INSERT content from record_sigo with bike nr:",$update,"");
$c_id = $dbt->insert_contentoid($dbh,$update,"");
$rows = 1 if($c_id);
}
}