Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Request Tracker: Commit

rt branch, 4.0/pg-session-last-updated-fix, created. rt-4.0.6-126-g4736f79

 

 

Request Tracker commit RSS feed   Index | Next | Previous | View Threaded


sunnavy at bestpractical

May 30, 2012, 12:51 PM

Post #1 of 1 (79 views)
Permalink
rt branch, 4.0/pg-session-last-updated-fix, created. rt-4.0.6-126-g4736f79

The branch, 4.0/pg-session-last-updated-fix has been created
at 4736f79aca8886e9a431a16137b57b4ab3267167 (commit)

- Log -----------------------------------------------------------------
commit 4736f79aca8886e9a431a16137b57b4ab3267167
Author: sunnavy <sunnavy [at] bestpractical>
Date: Thu May 31 03:31:35 2012 +0800

update LastUpdated for Pg backend session, see #19715

diff --git a/lib/RT/Interface/Web/Session.pm b/lib/RT/Interface/Web/Session.pm
index c5b88f1..e3ecced 100644
--- a/lib/RT/Interface/Web/Session.pm
+++ b/lib/RT/Interface/Web/Session.pm
@@ -86,6 +86,25 @@ sub Class {
|| 'Apache::Session::File';
eval "require $class";
die $@ if $@;
+
+ if ( $class eq 'Apache::Session::Postgres' ) {
+ require Apache::Session::Store::Postgres;
+ *Apache::Session::Store::Postgres::update = sub {
+ Apache::Session::Store::DBI::update(@_);
+ my $self = shift;
+ my $session = shift;
+ local $self->{dbh}->{RaiseError} = 1;
+ if ( !defined $self->{update_last_updated} ) {
+ $self->{update_sth} = $self->{dbh}->prepare_cached(
+ qq{
+ UPDATE $self->{'table_name'} SET LastUpdated = NOW() WHERE id = ?}
+ );
+ }
+
+ $self->{update_sth}->bind_param( 1, $session->{data}->{_session_id} );
+ $self->{update_sth}->execute;
+ };
+ }
return $class;
}


-----------------------------------------------------------------------
_______________________________________________
Rt-commit mailing list
Rt-commit [at] lists
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-commit

Request Tracker commit RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.