Changeset 98 in bookmarks for trunk


Ignore:
Timestamp:
06/10/15 16:17:18 (9 years ago)
Author:
peter
Message:

only initialize the controller once, and just set the request to a new Plack::Request each time the application is called

Location:
trunk/lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Bookmarks/Controller.pm

    r95 r98  
    2727); 
    2828has request => ( 
    29     is => 'ro', 
    30     required => 1, 
     29    is => 'rw', 
    3130); 
    3231 
  • trunk/lib/BookmarksApp.pm

    r92 r98  
    9494        } 
    9595    ); 
     96    $self->_controller( 
     97        Bookmarks::Controller->new({ 
     98            dbname  => $self->config->{dbname}, 
     99        }) 
     100    ); 
    96101} 
    97102 
     
    101106 
    102107    # initialize the controller based on this request 
    103     $self->_controller( 
    104         Bookmarks::Controller->new({ 
    105             request => Plack::Request->new($env), 
    106             dbname  => $self->config->{dbname}, 
    107         }) 
    108     ); 
     108    $self->_controller->request(Plack::Request->new($env)); 
    109109 
    110110    # dispatch to the app 
Note: See TracChangeset for help on using the changeset viewer.