[Jifty-commit] r4125 - in jifty/trunk: lib/Jifty/Web
jifty-commit at lists.jifty.org
jifty-commit at lists.jifty.org
Mon Sep 17 18:06:07 EDT 2007
Author: jesse
Date: Mon Sep 17 18:06:07 2007
New Revision: 4125
Modified:
jifty/trunk/ (props changed)
jifty/trunk/lib/Jifty/Web/Session.pm
Log:
r67329 at 000-251-384: jesse | 2007-09-17 18:05:43 -0400
* The cache was actually a huge performance problem
Modified: jifty/trunk/lib/Jifty/Web/Session.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Web/Session.pm (original)
+++ jifty/trunk/lib/Jifty/Web/Session.pm Mon Sep 17 18:06:07 2007
@@ -74,7 +74,6 @@
$session->create( key_type => "session" ) unless $session->id;
$self->_session($session);
- $self->{cache} = undef;
}
=head2 load_by_kv key => value
@@ -165,7 +164,7 @@
return undef unless $self->loaded;
- if ($key_type eq "continuation" or $key_type eq "session") {
+
my $setting = Jifty::Model::Session->new;
$setting->load_by_cols(
session_id => $self->id,
@@ -173,19 +172,6 @@
data_key => $key
);
return $setting->value;
- } else {
- unless ($self->{cache}) {
- my $settings = Jifty::Model::SessionCollection->new;
- $settings->limit( column => 'session_id', value => $self->id, case_sensitive => '1' );
- $settings->limit( column => 'key_type', value => 'continuation', operator => '!=', entry_aggregator => 'and', case_sensitive => '1' );
- $settings->limit( column => 'key_type', value => 'session', operator => '!=', entry_aggregator => 'and', case_sensitive => '1' );
- while (my $row = $settings->next) {
- $self->{cache}{$row->key_type}{$row->data_key} = $row->value;
- }
- }
-
- return $self->{cache}{$key_type}{$key};
- }
}
@@ -225,8 +211,6 @@
);
}
- $self->{cache}{$key_type}{$key} = $value
- if $self->{cache};
}
More information about the Jifty-commit
mailing list